X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-apply.c;h=4c4d1e1774ade358dbc3283df5d1b764a32821b8;hb=a3411f8a2d3acc311991cf2221efa9de81cd03f7;hp=cfd8fceb9033cf5c4c7924d96437b94a9c4fe226;hpb=500ac7f42e7f2ae42e33be3bbb7120b788175b1d;p=git.git diff --git a/builtin-apply.c b/builtin-apply.c index cfd8fceb9..4c4d1e177 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -2841,8 +2841,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;