projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] git-ls-files: generalized pathspecs
[git.git]
/
path.c
diff --git
a/path.c
b/path.c
index
7ef0d1b
..
b85f087
100644
(file)
--- a/
path.c
+++ b/
path.c
@@
-68,8
+68,13
@@
int git_mkstemp(char *path, size_t len, const char *template)
if ((env = getenv("TMPDIR")) == NULL) {
strcpy(pch, "/tmp/");
len -= 5;
if ((env = getenv("TMPDIR")) == NULL) {
strcpy(pch, "/tmp/");
len -= 5;
- } else
- len -= snprintf(pch, len, "%s/", env);
+ pch += 5;
+ } else {
+ size_t n = snprintf(pch, len, "%s/", env);
+
+ len -= n;
+ pch += n;
+ }
safe_strncpy(pch, template, len);
safe_strncpy(pch, template, len);