summaryrefslogtreecommitdiff
path: root/src/common/core.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-01-20 04:36:08 +0100
committerHaru <haru@dotalux.com>2015-01-20 04:41:33 +0100
commit4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4 (patch)
treedab9d12a6a4b95a37598e27e6e86d6047360d61b /src/common/core.c
parent03709c136ad300be631adfd38dc36c2433bda718 (diff)
downloadhercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.gz
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.bz2
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.xz
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.zip
Minor fixes and tweaks suggested by cppcheck
- Variable scopes reduced - Parenthesized ambiguous expressions - Removed or added NULL checks where (un)necessary - Corrected format strings - Fixed typos potentially leading to bugs Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/core.c')
-rw-r--r--src/common/core.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/common/core.c b/src/common/core.c
index 6ad971c86..8bf381589 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -240,7 +240,7 @@ static CMDLINEARG(help)
} else {
*altname = '\0';
}
- snprintf(paramnames, sizeof(paramnames), "%s%s%s", data->name, altname, data->options&CMDLINE_OPT_PARAM ? " <name>" : "");
+ snprintf(paramnames, sizeof(paramnames), "%s%s%s", data->name, altname, (data->options&CMDLINE_OPT_PARAM) ? " <name>" : "");
ShowInfo(" %-30s %s [%s]\n", paramnames, data->help ? data->help : "<no description provided>", cmdline->arg_source(data));
}
return false;
@@ -439,12 +439,11 @@ int main (int argc, char **argv) {
sockt->init();
do_init(argc,argv);
- {// Main runtime cycle
- int next;
- while (runflag != CORE_ST_STOP) {
- next = timer->perform(timer->gettick_nocache());
- sockt->perform(next);
- }
+
+ // Main runtime cycle
+ while (runflag != CORE_ST_STOP) {
+ int next = timer->perform(timer->gettick_nocache());
+ sockt->perform(next);
}
console->final();