From 4aec5379588b4a9147d641b6139a181bb747dd8d Mon Sep 17 00:00:00 2001 From: Haru Date: Mon, 17 Aug 2015 01:19:11 +0200 Subject: Removed some useless variables reported by the Clang static analyzer Signed-off-by: Haru --- src/map/atcommand.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'src/map/atcommand.c') 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; } -- cgit v1.2.3-60-g2f50