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/grfio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common/grfio.c') diff --git a/src/common/grfio.c b/src/common/grfio.c index 6e628a512..5be0c8237 100644 --- a/src/common/grfio.c +++ b/src/common/grfio.c @@ -655,7 +655,7 @@ static bool grfio_parse_restable_row(const char* row) char local[256]; FILELIST* entry; - if( sscanf(row, "%[^#\r\n]#%[^#\r\n]#", w1, w2) != 2 ) + if (sscanf(row, "%255[^#\r\n]#%255[^#\r\n]#", w1, w2) != 2) return false; if( strstr(w2, ".gat") == NULL && strstr(w2, ".rsw") == NULL ) @@ -805,7 +805,7 @@ void grfio_init(const char* fname) if( line[0] == '/' && line[1] == '/' ) continue; // skip comments - if( sscanf(line, "%[^:]: %[^\r\n]", w1, w2) != 2 ) + if (sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2) != 2) continue; // skip unrecognized lines // Entry table reading -- cgit v1.2.3-70-g09d2