summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-23 16:06:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-23 16:06:25 +0000
commitb8dfb46df78af9f46debb81805e0fc70243bb9fc (patch)
tree4e46613e17eb7377a7b0bd23a814ee77681bffa6 /file.c
parent33c9c0005b28c9897ef03ac595047e423221103e (diff)
BUFCHECK() doesn't update p/pend in loop.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/file.c b/file.c
index 5215af7..223b243 100644
--- a/file.c
+++ b/file.c
@@ -1589,7 +1589,7 @@ file_expand_path(fname, dname, result)
s++;
#endif
s = nextdirsep(b = s);
- BUFCHECK(p + (s-b) >= pend);
+ BUFCHECK(bdiff + (s-b) >= buflen);
memcpy(p, b, s-b);
p += s-b;
*p = '\0';
@@ -1613,7 +1613,7 @@ file_expand_path(fname, dname, result)
if (isdirsep(s[2])) {
/* specified drive letter, and full path */
/* skip drive letter */
- BUFCHECK(p + 2 >= pend);
+ BUFCHECK(bdiff + 2 >= buflen);
memcpy(p, s, 2);
p += 2;
s += 2;
@@ -1667,7 +1667,7 @@ file_expand_path(fname, dname, result)
b = s;
do s++; while (isdirsep(*s));
p = buf + (s - b);
- BUFCHECK(p >= pend);
+ BUFCHECK(bdiff >= buflen);
memset(buf, '/', p - buf);
}
if (p > buf && p[-1] == '/')
@@ -1718,7 +1718,7 @@ file_expand_path(fname, dname, result)
#endif
if (s > b) {
long rootdiff = root - buf;
- BUFCHECK(p + (s-b+1) >= pend);
+ BUFCHECK(bdiff + (s-b+1) >= buflen);
root = buf + rootdiff;
memcpy(++p, b, s-b);
p += s-b;
@@ -1733,7 +1733,7 @@ file_expand_path(fname, dname, result)
}
if (s > b) {
- BUFCHECK(p + (s-b) >= pend);
+ BUFCHECK(bdiff + (s-b) >= buflen);
memcpy(++p, b, s-b);
p += s-b;
}