aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-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;
}
}