summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2019-06-16 11:25:47 +0200
committerPatrick Steinhardt <ps@pks.im>2019-08-01 11:57:36 +0200
commit1721ab047da75562c6f0e5c72af6c3e0d6b7e7e5 (patch)
tree673255ec21b64e631eccfa91cc032736490bcefb
parent63d8cd189e7eb9a410f04283cbe46d3d3f0a1924 (diff)
downloadlibgit2-1721ab047da75562c6f0e5c72af6c3e0d6b7e7e5.tar.gz
unix: posix: avoid use of variadic macro `p_snprintf`
The macro `p_snprintf` is implemented as a variadic macro that calls `snprintf` directly with `__VA_ARGS__`. In C89, variadic macros are not allowed, but as the arguments of `p_snprintf` and `snprintf` are matching 1:1, we can fix this by simply removing the parameter list from `p_snprintf`.
-rw-r--r--src/unix/posix.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/unix/posix.h b/src/unix/posix.h
index f969f8362..d1f902489 100644
--- a/src/unix/posix.h
+++ b/src/unix/posix.h
@@ -59,7 +59,7 @@ GIT_INLINE(int) p_fsync(int fd)
#define p_strcasecmp(s1, s2) strcasecmp(s1, s2)
#define p_strncasecmp(s1, s2, c) strncasecmp(s1, s2, c)
#define p_vsnprintf(b, c, f, a) vsnprintf(b, c, f, a)
-#define p_snprintf(b, c, ...) snprintf(b, c, __VA_ARGS__)
+#define p_snprintf snprintf
#define p_mkstemp(p) mkstemp(p)
#define p_chdir(p) chdir(p)
#define p_chmod(p,m) chmod(p, m)