blob: 8f0c9dd535d8a9d201dc1e6f020931e61732b1b5 [file] [log] [blame]
From 09ca9865123e89a3b47d9791839fcfd9ea94fb14 Mon Sep 17 00:00:00 2001
From: Meena Shanmugam <meenashanmugam@google.com>
Date: Tue, 16 Aug 2022 19:15:38 +0000
Subject: [PATCH] Define snprintf only if it is not defined.
Since latest rsync enabled pedantic-errors, compiler complains
that snprintf is redefined. Define snprintf only if it is not defined.
---
rsync.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/rsync.h b/rsync.h
index 1cc037c5..8dbcc238 100644
--- a/rsync.h
+++ b/rsync.h
@@ -1204,9 +1204,11 @@ int vsnprintf(char *str, size_t count, const char *fmt, va_list args);
#endif
#if !defined HAVE_SNPRINTF || !defined HAVE_C99_VSNPRINTF
+#ifndef snprintf
#define snprintf rsync_snprintf
int snprintf(char *str, size_t count, const char *fmt,...);
#endif
+#endif
#ifndef HAVE_STRERROR
extern char *sys_errlist[];
--
2.37.1.595.g718a3a8f04-goog