Skip to content

Commit 3f80d16

Browse files
committed
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
2 parents 0709261 + 24041d6 commit 3f80d16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ char *prefix_path_gently(const char *prefix, int len,
102102
return NULL;
103103
}
104104
} else {
105-
sanitized = xstrfmt("%.*s%s", len, prefix, path);
105+
sanitized = xstrfmt("%.*s%s", len, len ? prefix : "", path);
106106
if (remaining_prefix)
107107
*remaining_prefix = len;
108108
if (normalize_path_copy_len(sanitized, sanitized, remaining_prefix)) {

0 commit comments

Comments
 (0)