logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git
commit: c1577503387c765fe71fc3450672f6eb2ca1283a
parent 8027be4baef8f41d74f92dee3399b5160d00dcf4
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri, 20 Sep 2024 05:05:39 +0200

lib/strtodur: unify error message formatting

Diffstat:

Mlib/strtodur.c12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/strtodur.c b/lib/strtodur.c @@ -25,11 +25,11 @@ strtodur(char *s, struct timespec *dur) { if(errno == 0) { - fprintf(stderr, "strtodur: Error: Not a number: %s\n", s); + fprintf(stderr, "strtodur: error: Not a number: %s\n", s); } else { - perror("strtodur: Error with sscanf"); + perror("strtodur: error: sscanf"); errno = 0; } return -1; @@ -52,11 +52,11 @@ strtodur(char *s, struct timespec *dur) { if(errno == 0) { - fprintf(stderr, "strtodur: Error: Decimal part is not a number: %s\n", s); + fprintf(stderr, "strtodur: error: Decimal part is not a number: %s\n", s); } else { - perror("strtodur: Error with sscanf"); + perror("strtodur: error: sscanf"); errno = 0; } return -1; @@ -70,7 +70,7 @@ strtodur(char *s, struct timespec *dur) if(s[1] != 0) { - fprintf(stderr, "strtodur: Error: suffix '%s' is too long, should be only one character\n", s); + fprintf(stderr, "strtodur: error: suffix '%s' is too long, should be only one character\n", s); return -1; } @@ -88,7 +88,7 @@ strtodur(char *s, struct timespec *dur) dur->tv_sec *= 24 * 60 * 60; break; default: - fprintf(stderr, "strtodur: Error: Unknown suffix %c\n", s[0]); + fprintf(stderr, "strtodur: error: Unknown suffix %c\n", s[0]); return -1; }