Skip to content

Commit 6c2fd5a

Browse files
committed
Add attribute format printf for Q_vsnprintf
1 parent 2063497 commit 6c2fd5a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

code/qcommon/q_shared.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ however, uses Microsoft's broken _vsnprintf() function.
779779
=============
780780
*/
781781

782-
int Q_vsnprintf(char *str, size_t size, const char *format, va_list ap)
782+
int Q_vsnprintf(char *str, size_t size, const char *format, va_list ap) __attribute__((format(printf, 3, 0)))
783783
{
784784
int retval;
785785

code/qcommon/q_shared.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ typedef int intptr_t;
187187
#ifdef _WIN32
188188
// vsnprintf is ISO/IEC 9899:1999
189189
// abstracting this to make it portable
190-
int Q_vsnprintf(char *str, size_t size, const char *format, va_list ap);
190+
int Q_vsnprintf(char *str, size_t size, const char *format, va_list ap) __attribute__((format(printf, 3, 0)));
191191
#else
192192
#define Q_vsnprintf vsnprintf
193193
#endif

0 commit comments

Comments
 (0)