Skip to content

Commit 1721ab0

Browse files
committed
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`.
1 parent 63d8cd1 commit 1721ab0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/unix/posix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ GIT_INLINE(int) p_fsync(int fd)
5959
#define p_strcasecmp(s1, s2) strcasecmp(s1, s2)
6060
#define p_strncasecmp(s1, s2, c) strncasecmp(s1, s2, c)
6161
#define p_vsnprintf(b, c, f, a) vsnprintf(b, c, f, a)
62-
#define p_snprintf(b, c, ...) snprintf(b, c, __VA_ARGS__)
62+
#define p_snprintf snprintf
6363
#define p_mkstemp(p) mkstemp(p)
6464
#define p_chdir(p) chdir(p)
6565
#define p_chmod(p,m) chmod(p, m)

0 commit comments

Comments
 (0)