summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-08-17 01:19:11 +0200
committerHaru <haru@dotalux.com>2015-08-17 01:19:11 +0200
commit4aec5379588b4a9147d641b6139a181bb747dd8d (patch)
tree696caa641f4cd5f2e203b72fd3e6396b435d3ead
parentc215c9c21ae463a2cbdffea06a7e24732be17b1b (diff)
downloadhercules-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>
-rw-r--r--src/map/atcommand.c22
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;
}