Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
probe_utf8_pathname_composition: use internal strbuf
[gitweb.git]
/
builtin
/
apply.c
diff --git
a/builtin/apply.c
b/builtin/apply.c
index 4aa53f7fd87d5fd23c0929360b6746f48e8e3e73..094a20f4896fa0a29d10e4fa33c656ea53616bfc 100644
(file)
--- a/
builtin/apply.c
+++ b/
builtin/apply.c
@@
-698,10
+698,7
@@
static char *find_name_common(const char *line, const char *def,
}
if (root) {
- char *ret = xmalloc(root_len + len + 1);
- strcpy(ret, root);
- memcpy(ret + root_len, start, len);
- ret[root_len + len] = '\0';
+ char *ret = xstrfmt("%s%.*s", root, len, start);
return squash_slash(ret);
}