diff options
author | zachir <zachir@librem.one> | 2024-03-11 01:57:53 -0500 |
---|---|---|
committer | zachir <zachir@librem.one> | 2024-03-11 01:57:53 -0500 |
commit | 934a7be0be6764c8b47aedbf6aad22654d3bd3f2 (patch) | |
tree | d4f7d8462ae2efd0ffc0f3659d0601e846f2fa53 | |
parent | ccb5c84449f930aa66d8ee9d47f7a5d806ce5df5 (diff) |
Fixes logic error with quiet
Before, quiet worked in reverse, i.e. text was only displayed when -q
was passed. Also, even now will not return 1 with an odd number when
quiet is not passed.
-rw-r--r-- | src/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -61,13 +61,14 @@ int main(int argc, char **argv) { } if (value) { if (result % 2 == 0) { - if (quiet) { + if (!quiet) { fprintf(stdout, "even\n"); } return 0; } else { - if (quiet) { + if (!quiet) { fprintf(stdout, "odd\n"); + return 0; } return 1; } |