diff options
author | Jakob Kaivo <jkk@ung.org> | 2022-03-28 11:35:56 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2022-03-28 11:35:56 -0400 |
commit | c7ee64df516ee5a73eccb682b9095fa2b7e4b24c (patch) | |
tree | 8bef5be8bae2c2ee682ec17ca800130fae08f8e7 | |
parent | 3d92b273bbbff3200478924f76455659a8638274 (diff) |
minor style adjustments
-rw-r--r-- | menudriver.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/menudriver.c b/menudriver.c index 7447e73..5071ad2 100644 --- a/menudriver.c +++ b/menudriver.c @@ -66,6 +66,7 @@ static int read_next(size_t n, char buf[static n]) for (char *end = strchr(buf, '\n'); isspace(*end); end--) { *end = '\0'; } + return 1; } @@ -177,7 +178,8 @@ int lastval(char *last) void menudrive(const char *menuviewer, const char *viewer, char *dir) { - char next[40] = "", last[40] = "."; + char next[40] = ""; + char last[40] = "."; int bad = 0; @@ -216,13 +218,9 @@ void menudrive(const char *menuviewer, const char *viewer, char *dir) if (strcmp(next, ".") == 0) { strcpy(next, last); /* repeat last option */ - } - - if (strcmp(next, "+") == 0 && lastval(last)) { + } else if (strcmp(next, "+") == 0 && lastval(last)) { (void)sprintf(next, "%d", atoi(last) + 1); - } - - if (strcmp(next, "-") == 0 && lastval(last)) { + } else if (strcmp(next, "-") == 0 && lastval(last)) { (void)sprintf(next, "%d", atoi(last) - 1); } |