From: Bart Van Assche Date: Mon, 12 Mar 2018 21:24:27 +0000 (-0700) Subject: parse: Fix two compiler warnings X-Git-Tag: fio-3.6~42^2 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=e99161b4f81e2bbad80715184b9ee79abd4d0bc8 parse: Fix two compiler warnings Avoid that gcc on NetBSD reports the following compiler warnings: CC parse.o parse.c: In function 'get_mult_time': parse.c:175: warning: array subscript has type 'char' parse.c: In function '__get_mult_bytes': parse.c:221: warning: array subscript has type 'char' Signed-off-by: Bart Van Assche --- diff --git a/parse.c b/parse.c index a9ee1cee..fdb66115 100644 --- a/parse.c +++ b/parse.c @@ -172,7 +172,7 @@ static unsigned long long get_mult_time(const char *str, int len, c = strdup(p); for (i = 0; i < strlen(c); i++) - c[i] = tolower(c[i]); + c[i] = tolower((unsigned char)c[i]); if (!strncmp("us", c, 2) || !strncmp("usec", c, 4)) mult = 1; @@ -218,7 +218,7 @@ static unsigned long long __get_mult_bytes(const char *p, void *data, c = strdup(p); for (i = 0; i < strlen(c); i++) { - c[i] = tolower(c[i]); + c[i] = tolower((unsigned char)c[i]); if (is_separator(c[i])) { c[i] = '\0'; break;