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 <>
Signed-off-by: Junio C Hamano <>
This commit is contained in:
Jeff King 2018-07-24 06:51:25 -04:00 committed by Junio C Hamano
parent 26114c00be
commit f3e76ed228
1 changed files with 1 additions and 1 deletions

View File

@ -469,7 +469,7 @@ int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint)
hint = 32;
while (hint < STRBUF_MAXLINK) {
int len;
ssize_t len;
strbuf_grow(sb, hint);
len = readlink(path, sb->buf, hint);