ruby-changes:11320
From: akr <ko1@a...>
Date: Fri, 13 Mar 2009 21:00:17 +0900 (JST)
Subject: [ruby-changes:11320] Ruby:r22934 (trunk): * dln.c (dln_find_1): compare fspace in size_t world.
akr 2009-03-13 21:00:04 +0900 (Fri, 13 Mar 2009) New Revision: 22934 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=22934 Log: * dln.c (dln_find_1): compare fspace in size_t world. Modified files: trunk/ChangeLog trunk/dln.c Index: ChangeLog =================================================================== --- ChangeLog (revision 22933) +++ ChangeLog (revision 22934) @@ -1,3 +1,7 @@ +Fri Mar 13 20:58:11 2009 Tanaka Akira <akr@f...> + + * dln.c (dln_find_1): compare fspace in size_t world. + Fri Mar 13 18:58:04 2009 Nobuyoshi Nakada <nobu@r...> * configure.in (CFLAGS, CXXFLAGS): moved after warnflags. Index: dln.c =================================================================== --- dln.c (revision 22933) +++ dln.c (revision 22934) @@ -1616,8 +1616,9 @@ home = getenv("HOME"); if (home != NULL) { i = strlen(home); - if ((fspace -= i) < 0) + if (fspace < i) goto toolong; + fspace -= i; memcpy(bp, home, i); bp += i; } @@ -1625,8 +1626,9 @@ l--; } if (l > 0) { - if ((fspace -= l) < 0) + if (fspace < l) goto toolong; + fspace -= l; memcpy(bp, dp, l); bp += l; } @@ -1638,7 +1640,7 @@ /* now append the file name */ i = strlen(fname); - if ((fspace -= i) < 0) { + if (fspace < i) { toolong: fprintf(stderr, "openpath: pathname too long (ignored)\n"); *bp = '\0'; @@ -1646,6 +1648,7 @@ fprintf(stderr, "\tFile \"%s\"\n", fname); goto next; } + fspace -= i; memcpy(bp, fname, i + 1); #if defined(DOSISH) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/