diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-08-16 01:08:25 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-16 01:08:25 +0300 |
commit | 7d020f5a78a1ae7ff47d65a2adc79171c0cf9cb7 (patch) | |
tree | 5196c1aa277fe6619a24b9f5607f062f20f68b2e /builtin | |
parent | bce8031d9a1ff3b791f9e4c1cd1e5634faaf55fb (diff) | |
parent | 7726d360b5ba859ae2b6ceefc5d88cc518c78063 (diff) |
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 'builtin')
-rw-r--r-- | builtin/init-db.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/init-db.c b/builtin/init-db.c index 4ecf909368..12ddda7e7b 100644 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@ -73,7 +73,8 @@ static void copy_templates_1(struct strbuf *path, struct strbuf *template_path, continue; else if (S_ISLNK(st_template.st_mode)) { struct strbuf lnk = STRBUF_INIT; - if (strbuf_readlink(&lnk, template_path->buf, 0) < 0) + if (strbuf_readlink(&lnk, template_path->buf, + st_template.st_size) < 0) die_errno(_("cannot readlink '%s'"), template_path->buf); if (symlink(lnk.buf, path->buf)) die_errno(_("cannot symlink '%s' '%s'"), |