diff options
author | Haru <haru@dotalux.com> | 2014-08-07 03:39:13 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2014-08-07 05:37:38 +0200 |
commit | c45e3fa9793a273a0eab40d1626bcda7d710552c (patch) | |
tree | 4f6c9d47770a15c8cbfe065f7ee9203f77e57022 /src/char/char.c | |
parent | caf89724767465ecf339c391bb6d7a937d563fb2 (diff) | |
download | hercules-c45e3fa9793a273a0eab40d1626bcda7d710552c.tar.gz hercules-c45e3fa9793a273a0eab40d1626bcda7d710552c.tar.bz2 hercules-c45e3fa9793a273a0eab40d1626bcda7d710552c.tar.xz hercules-c45e3fa9793a273a0eab40d1626bcda7d710552c.zip |
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 <haru@dotalux.com>
Diffstat (limited to 'src/char/char.c')
-rw-r--r-- | src/char/char.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/char/char.c b/src/char/char.c index fe17fd14f..9abb17257 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -3146,9 +3146,8 @@ int parse_frommap(int fd) int aid = RFIFOL(fd,4), cid = RFIFOL(fd,8), size = RFIFOW(fd,2); struct online_char_data* character; - if (size - 13 != sizeof(struct mmo_charstatus)) - { - ShowError("parse_from_map (save-char): Size mismatch! %d != %d\n", size-13, sizeof(struct mmo_charstatus)); + if (size - 13 != sizeof(struct mmo_charstatus)) { + ShowError("parse_from_map (save-char): Size mismatch! %d != %"PRIuS"\n", size-13, sizeof(struct mmo_charstatus)); RFIFOSKIP(fd,size); break; } @@ -5025,7 +5024,7 @@ int char_lan_config_read(const char *lancfgName) if ((line[0] == '/' && line[1] == '/') || line[0] == '\n' || line[1] == '\n') continue; - if(sscanf(line,"%[^:]: %[^:]:%[^:]:%[^\r\n]", w1, w2, w3, w4) != 4) { + if (sscanf(line,"%63[^:]: %63[^:]:%63[^:]:%63[^\r\n]", w1, w2, w3, w4) != 4) { ShowWarning("Error syntax of configuration file %s in line %d.\n", lancfgName, line_num); continue; @@ -5074,7 +5073,7 @@ void sql_config_read(const char* cfgName) if(line[0] == '/' && line[1] == '/') continue; - if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) != 2) + if (sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2) != 2) continue; if(!strcmpi(w1,"char_db")) @@ -5182,7 +5181,7 @@ int char_config_read(const char* cfgName) if (line[0] == '/' && line[1] == '/') continue; - if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) != 2) + if (sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2) != 2) continue; remove_control_chars(w1); |