Author | Jamozed <[email protected]> |
Date | 2020-08-13 13:20:07 |
Commit | 7c8ef2661e7a929e26d7657119f4f3fdf032dd97 |
Parent | 01daec69e538f90672452a007e08d962552a8907 |
sum: Fix inconsistencies
Diffstat
M | src/sum.c | | | 22 | +++++++++------------- |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/sum.c b/src/sum.c index 5e2ad25..b654b6e 100644 --- a/src/sum.c +++ b/src/sum.c @@ -1,4 +1,4 @@ -// sum.c, version 1.0.0 +// sum.c, version 1.0.1 // OMKOV coreutils sum // Copyright (C) 2020, Jakob Wakeling // All rights reserved. @@ -6,9 +6,6 @@ /* OMKOV Permissive Licence, version 1.0 -Copyright (C) 2020, Jakob Wakeling -All rights reserved. - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal with the Software without restriction, including without limitation the rights to @@ -33,15 +30,14 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. */ +#include "lib/error.h" #include "optget.h" -#include <error.h> - #include <stdbool.h> #include <stdint.h> #include <stdio.h> -#define VERSION "1.0.0" +#define VERSION "1.0.1" static inline int sum(const char *file); @@ -50,8 +46,8 @@ static inline uint32_t sysv(FILE *fi, size_t *fl); static uint32_t (*fn)(FILE *, size_t *) = bsd; -static void help(void); -static void version(void); +static void hlp(void); +static void ver(void); int main(int ac, char *av[]) { lop_t lops[] = { @@ -64,8 +60,8 @@ int main(int ac, char *av[]) { while ((o = optget(&opt, av, 1)) != -1) switch (o) { case 'r': { fn = bsd; break; } case 's': { fn = sysv; break; } - case 256: { help(); return 0; } - case 257: { version(); return 0; } + case 256: { hlp(); return 0; } + case 257: { ver(); return 0; } default: { return 1; } } @@ -119,7 +115,7 @@ static inline uint32_t sysv(FILE *fi, size_t *bl) { *bl = *bl / 512 + 1; return sum; } -static void help(void) { +static void hlp(void) { puts("sum - write file checksums and block counts\n"); puts("usage: sum [-rs] [file...]\n"); puts("options:"); @@ -130,7 +126,7 @@ static void help(void) { return; } -static void version(void) { +static void ver(void) { puts("OMKOV coreutils sum, version " VERSION); puts("Copyright (C) 2020, Jakob Wakeling"); puts("All rights reserved.");