summaryrefslogtreecommitdiff
path: root/refs/files-backend.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-08-15 22:08:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-15 22:08:25 (GMT)
commit7d020f5a78a1ae7ff47d65a2adc79171c0cf9cb7 (patch)
tree5196c1aa277fe6619a24b9f5607f062f20f68b2e /refs/files-backend.c
parentbce8031d9a1ff3b791f9e4c1cd1e5634faaf55fb (diff)
parent7726d360b5ba859ae2b6ceefc5d88cc518c78063 (diff)
downloadgit-7d020f5a78a1ae7ff47d65a2adc79171c0cf9cb7.zip
git-7d020f5a78a1ae7ff47d65a2adc79171c0cf9cb7.tar.gz
git-7d020f5a78a1ae7ff47d65a2adc79171c0cf9cb7.tar.bz2
Merge branch 'jk/size-t'
Code clean-up to use size_t/ssize_t when they are the right type. * jk/size-t: strbuf_humanise: use unsigned variables pass st.st_size as hint for strbuf_readlink() strbuf_readlink: use ssize_t strbuf: use size_t for length in intermediate variables reencode_string: use size_t for string lengths reencode_string: use st_add/st_mult helpers
Diffstat (limited to 'refs/files-backend.c')
-rw-r--r--refs/files-backend.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index b9eb3aa..1f1a98e 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -363,7 +363,7 @@ stat_ref:
/* Follow "normalized" - ie "refs/.." symlinks by hand */
if (S_ISLNK(st.st_mode)) {
strbuf_reset(&sb_contents);
- if (strbuf_readlink(&sb_contents, path, 0) < 0) {
+ if (strbuf_readlink(&sb_contents, path, st.st_size) < 0) {
if (errno == ENOENT || errno == EINVAL)
/* inconsistent with lstat; retry */
goto stat_ref;