[PATCH 4/6] strbuf_readlink: use ssize_t
- From
Jeff King <peff@peff.net>
- Date
- Jul 24, 2018, 10:51 UTC
- Message-ID
- <20180724105125.GD17165@sigill.intra.peff.net>
- In-Reply-To
- <20180724104852.GA14638@sigill.intra.peff.net>
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> --- strbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/strbuf.c b/strbuf.c index 6ff1f80129..db9069c937 100644 --- a/strbuf.c +++ b/strbuf.c @@ -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);
-- 2.18.0.542.g2bf2fc4f7e