Code

git-config.txt: fix a typo
[git.git] / builtin-apply.c
index e9d49f133afd559d2df3f09997c08a61dfc2ff86..50b623e54c003fb5bbe183568d13f496c3c41c25 100644 (file)
@@ -2850,8 +2850,8 @@ static void create_one_file(char *path, unsigned mode, const char *buf, unsigned
                unsigned int nr = getpid();
 
                for (;;) {
-                       const char *newpath;
-                       newpath = mkpath("%s~%u", path, nr);
+                       char newpath[PATH_MAX];
+                       mksnpath(newpath, sizeof(newpath), "%s~%u", path, nr);
                        if (!try_create_file(newpath, mode, buf, size)) {
                                if (!rename(newpath, path))
                                        return;