X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=path.c;h=a074aea64921eb1fb90f079ede9087e6b8109f6a;hb=6e13921b4f7adcc7316a76c0c4955b85b1589a65;hp=eb24017535f944a2c5dbc46663c02937cff69cd3;hpb=832e719d79296f1942a2aca5fb067bc610986fc4;p=git.git diff --git a/path.c b/path.c index eb2401753..a074aea64 100644 --- a/path.c +++ b/path.c @@ -41,7 +41,7 @@ char *mksnpath(char *buf, size_t n, const char *fmt, ...) len = vsnprintf(buf, n, fmt, args); va_end(args); if (len >= n) { - snprintf(buf, n, bad_path); + strlcpy(buf, bad_path, n); return buf; } return cleanup_path(buf); @@ -63,7 +63,7 @@ static char *git_vsnpath(char *buf, size_t n, const char *fmt, va_list args) goto bad; return cleanup_path(buf); bad: - snprintf(buf, n, bad_path); + strlcpy(buf, bad_path, n); return buf; }