summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-04-22 22:45:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-04-22 22:45:08 (GMT)
commit3f80d16c1c0db9834806e3c430197a8d3442094c (patch)
tree1ecbc8506dc20a6129880dfd46deaeea95212d6d /setup.c
parent0709261a83f0a386c6415d889a6e2617e62db710 (diff)
parent24041d6be54d89b5fb0b2bbf70df04bbbff6ba9e (diff)
downloadgit-3f80d16c1c0db9834806e3c430197a8d3442094c.zip
git-3f80d16c1c0db9834806e3c430197a8d3442094c.tar.gz
git-3f80d16c1c0db9834806e3c430197a8d3442094c.tar.bz2
Merge branch 'jc/xstrfmt-null-with-prec-0'
* jc/xstrfmt-null-with-prec-0: setup.c: do not feed NULL to "%.*s" even with precision 0
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/setup.c b/setup.c
index 1563cd4..c86bf5c 100644
--- a/setup.c
+++ b/setup.c
@@ -102,7 +102,7 @@ char *prefix_path_gently(const char *prefix, int len,
return NULL;
}
} else {
- sanitized = xstrfmt("%.*s%s", len, prefix, path);
+ sanitized = xstrfmt("%.*s%s", len, len ? prefix : "", path);
if (remaining_prefix)
*remaining_prefix = len;
if (normalize_path_copy_len(sanitized, sanitized, remaining_prefix)) {