summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cf219d8)
raw | patch | inline | side by side (parent: cf219d8)
author | Linus Torvalds <torvalds@linux-foundation.org> | |
Wed, 17 Dec 2008 18:31:36 +0000 (10:31 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 17 Dec 2008 21:36:34 +0000 (13:36 -0800) |
The code was already set up to not really need it, so this just massages
it a bit to remove the use entirely.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
it a bit to remove the use entirely.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c | patch | blob | history |
index 4b2029caa1c4a33154716ead5c385639f4b3f856..f160c1a35b786c8b1bb4451c254915bffde0fae3 100644 (file)
--- a/diff.c
+++ b/diff.c
if (S_ISLNK(st.st_mode)) {
int ret;
char buf[PATH_MAX + 1]; /* ought to be SYMLINK_MAX */
- size_t sz = xsize_t(st.st_size);
- if (sizeof(buf) <= st.st_size)
- die("symlink too long: %s", name);
- ret = readlink(name, buf, sz);
+ ret = readlink(name, buf, sizeof(buf));
if (ret < 0)
die("readlink(%s)", name);
- prep_temp_blob(temp, buf, sz,
+ if (ret == sizeof(buf))
+ die("symlink too long: %s", name);
+ prep_temp_blob(temp, buf, ret,
(one->sha1_valid ?
one->sha1 : null_sha1),
(one->sha1_valid ?