commit 1b5885dae14bb58185444846d5d70882016ac4cc parent 06f34bb4c7136e66306fdb41466bccbdd8f62ffd Author: Louis Burda <quent.burda@gmail.com> Date: Sat, 19 Jun 2021 11:30:10 +0200 src: small tweak for readability Diffstat:
M | src/main.c | | | 10 | ++++------ |
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git 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; } }