From c45e3fa9793a273a0eab40d1626bcda7d710552c Mon Sep 17 00:00:00 2001 From: Haru Date: Thu, 7 Aug 2014 03:39:13 +0200 Subject: Corrected several format-string errors through the code - Functions that expect a printf-style format string are now marked as such, so that gcc/clang will emit a warning warn you if you mismatch format string and arguments. Signed-off-by: Haru --- src/common/strlib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common/strlib.h') diff --git a/src/common/strlib.h b/src/common/strlib.h index 7f84d2893..00a588772 100644 --- a/src/common/strlib.h +++ b/src/common/strlib.h @@ -82,7 +82,7 @@ struct strlib_interface { /// Works like snprintf, but always null-terminates the buffer. /// Returns the size of the string (without null-terminator) /// or -1 if the buffer is too small. - int (*safesnprintf) (char* buf, size_t sz, const char* fmt, ...); + int (*safesnprintf) (char *buf, size_t sz, const char *fmt, ...) __attribute__((format(printf, 3, 4))); /// Returns the line of the target position in the string. /// Lines start at 1. @@ -99,7 +99,7 @@ struct strlib_interface *strlib; struct stringbuf_interface { StringBuf* (*Malloc) (void); void (*Init) (StringBuf* self); - int (*Printf) (StringBuf* self, const char* fmt, ...); + int (*Printf) (StringBuf *self, const char *fmt, ...) __attribute__((format(printf, 2, 3))); int (*Vprintf) (StringBuf* self, const char* fmt, va_list args); int (*Append) (StringBuf* self, const StringBuf *sbuf); int (*AppendStr) (StringBuf* self, const char* str); -- cgit v1.2.3-60-g2f50