Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'jc/xstrfmt-null-with-prec-0'
author
Junio C Hamano
<gitster@pobox.com>
Fri, 22 Apr 2016 22:45:07 +0000
(15:45 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 22 Apr 2016 22:45:08 +0000
(15:45 -0700)
* jc/xstrfmt-null-with-prec-0:
setup.c: do not feed NULL to "%.*s" even with precision 0
setup.c
patch
|
blob
|
history
raw
(from parent 1:
0709261
)
diff --git
a/setup.c
b/setup.c
index 1563cd42df2865d9f4390c9e68cdc666b45fcf96..c86bf5c9fabeab4b60b0696b9ae9b2f0f2bb720e 100644
(file)
--- 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)) {