summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-05-02 14:24:14 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-05-02 14:24:14 -0700
commit97d5165780f21b9a52002f2bbf5a1727e0e8ff6c (patch)
tree276c0d6aea49414c23f3a6d28830751a4cce8410 /setup.c
parentMerge branch 'ew/send-email-drop-data-dumper' into maint (diff)
parentsetup.c: do not feed NULL to "%.*s" even with precision 0 (diff)
downloadtgif-97d5165780f21b9a52002f2bbf5a1727e0e8ff6c.tar.xz
Merge branch 'jc/xstrfmt-null-with-prec-0' into maint
Code cleanup. * 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 1563cd42df..c86bf5c9fa 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)) {