From 9db56f71b91153f4076a796c80c61f00edd8b700 Mon Sep 17 00:00:00 2001 From: Daniel Lowe Date: Mon, 10 Nov 2008 16:07:52 -0500 Subject: Fix non-literal format in printf-style calls These were found using gcc 4.3.2-1ubuntu11 with the warning: warning: format not a string literal and no format arguments Incorporated suggestions from Brandon Casey . Signed-off-by: Junio C Hamano --- path.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'path.c') diff --git a/path.c b/path.c index eb24017535..a074aea649 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; } -- cgit v1.2.1