strbuf_readlink: use ssize_t
The return type of readlink() is ssize_t, not int. This probably doesn't matter in practice, as it would require a 2GB symlink destination, but it doesn't hurt to be careful. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
26114c00be
commit
f3e76ed228
2
strbuf.c
2
strbuf.c
@ -469,7 +469,7 @@ int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint)
|
|||||||
hint = 32;
|
hint = 32;
|
||||||
|
|
||||||
while (hint < STRBUF_MAXLINK) {
|
while (hint < STRBUF_MAXLINK) {
|
||||||
int len;
|
ssize_t len;
|
||||||
|
|
||||||
strbuf_grow(sb, hint);
|
strbuf_grow(sb, hint);
|
||||||
len = readlink(path, sb->buf, hint);
|
len = readlink(path, sb->buf, hint);
|
||||||
|
Reference in New Issue
Block a user