diff options
author | Haru <haru@dotalux.com> | 2015-08-17 01:19:11 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2015-08-17 01:19:11 +0200 |
commit | 4aec5379588b4a9147d641b6139a181bb747dd8d (patch) | |
tree | 696caa641f4cd5f2e203b72fd3e6396b435d3ead /src | |
parent | c215c9c21ae463a2cbdffea06a7e24732be17b1b (diff) | |
download | hercules-4aec5379588b4a9147d641b6139a181bb747dd8d.tar.gz hercules-4aec5379588b4a9147d641b6139a181bb747dd8d.tar.bz2 hercules-4aec5379588b4a9147d641b6139a181bb747dd8d.tar.xz hercules-4aec5379588b4a9147d641b6139a181bb747dd8d.zip |
Removed some useless variables reported by the Clang static analyzer
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/map/atcommand.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 95db0c2e6..ed0e282bc 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -8785,12 +8785,10 @@ ACMD(channel) { } else if (strcmpi(subcmd,"list") == 0) { // sub1 = list type; sub2 = unused; sub3 = unused if (sub1[0] != '\0' && strcmpi(sub1,"colors") == 0) { - char mout[40]; for (k = 0; k < channel->config->colors_count; k++) { - unsigned short msg_len = 1; - msg_len += sprintf(mout, "[ %s list colors ] : %s", command, channel->config->colors_name[k]); + sprintf(atcmd_output, "[ %s list colors ] : %s", command, channel->config->colors_name[k]); - clif->messagecolor_self(fd, channel->config->colors[k], mout); + clif->messagecolor_self(fd, channel->config->colors[k], atcmd_output); } } else { DBIterator *iter = db_iterator(channel->db); @@ -9169,14 +9167,11 @@ ACMD(channel) { /* debug only, delete after */ ACMD(fontcolor) { unsigned char k; - unsigned short msg_len = 1; - char mout[40]; - if( !message || !*message ) { - for( k = 0; k < channel->config->colors_count; k++ ) { - msg_len += sprintf(mout, "[ %s ] : %s", command, channel->config->colors_name[k]); - - clif->messagecolor_self(fd, channel->config->colors[k], mout); + if (!message || !*message) { + for (k = 0; k < channel->config->colors_count; k++) { + sprintf(atcmd_output, "[ %s ] : %s", command, channel->config->colors_name[k]); + clif->messagecolor_self(fd, channel->config->colors[k], atcmd_output); } return false; } @@ -9197,9 +9192,8 @@ ACMD(fontcolor) { } sd->fontcolor = k + 1; - msg_len += sprintf(mout, "Color changed to '%s'", channel->config->colors_name[k]); - - clif->messagecolor_self(fd, channel->config->colors[k], mout); + sprintf(atcmd_output, "Color changed to '%s'", channel->config->colors_name[k]); + clif->messagecolor_self(fd, channel->config->colors[k], atcmd_output); return true; } |