Browse Source

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
maint
Junio C Hamano 9 years ago
parent
commit
97d5165780
  1. 2
      setup.c

2
setup.c

@ -102,7 +102,7 @@ char *prefix_path_gently(const char *prefix, int len, @@ -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)) {

Loading…
Cancel
Save