aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2021-06-19 11:30:10 +0200
committerLouis Burda <quent.burda@gmail.com>2021-06-19 11:30:10 +0200
commit1b5885dae14bb58185444846d5d70882016ac4cc (patch)
tree89e259a045480e2206c3da097981d627162952ab
parent06f34bb4c7136e66306fdb41466bccbdd8f62ffd (diff)
downloadenowars5-service-stldoctor-1b5885dae14bb58185444846d5d70882016ac4cc.tar.gz
enowars5-service-stldoctor-1b5885dae14bb58185444846d5d70882016ac4cc.zip
src: small tweak for readability
-rw-r--r--src/main.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index de2bd48..43dce40 100644
--- a/src/main.c
+++ b/src/main.c
@@ -106,12 +106,10 @@ help_cmd(const char *arg)
{
int i;
- if (arg) {
- for (i = 0; i < ARRSIZE(commands); i++) {
- if (!strcmp(commands[i].name, arg)) {
- printf("%s\n", commands[i].desc);
- return;
- }
+ for (i = 0; arg && i < ARRSIZE(commands); i++) {
+ if (!strcmp(commands[i].name, arg)) {
+ printf("%s\n", commands[i].desc);
+ return;
}
}