logo

utils

~/.local/bin tools and git-hooks git clone https://hacktivis.me/git/utils.git
commit: 43957cf80d6aa56acd7357f585527603509db482
parent 9fd15b4214ea8d1831ade80e41b8153939d490b4
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon, 14 Feb 2022 21:37:16 +0100

bin/humanize: Remove error handling from dehumanize_number

Diffstat:

Mbin/humanize.c15++-------------
1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/bin/humanize.c b/bin/humanize.c @@ -76,19 +76,8 @@ main(int argc, char *argv[]) int err = humanize_number(buffer, buflen, n, "", HN_AUTOSCALE, flags | divisor); if(err < 0) { - switch(errno) - { - case EINVAL: - fprintf(stderr, "humanize_number: Number carried an unknown suffix.\n"); - return 1; - case ERANGE: - fprintf(stderr, "humanize_number: Represents a number that does not fit in result.\n"); - return 1; - case 0: fprintf(stderr, "humanize_number: Unknown error.\n"); return 1; - default: - fprintf(stderr, "humanize_number: %s is %s\n", argv[argi], strerror(errno)); - return 1; - } + fprintf(stderr, "humanize_number: %s is %s\n", argv[argi], strerror(errno)); + return 1; } printf("%s ", buffer);