From 245142ff7554290cf666e3ef6b7b57512bf17d75 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 8 Nov 2006 12:49:21 +0100 Subject: [PATCH] [PATCH] Fix signedness issue Don't compare standard char to -1. Signed-off-by: Jens Axboe --- init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.c b/init.c index 00f95765..badd635a 100644 --- a/init.c +++ b/init.c @@ -516,16 +516,16 @@ static void fixup_options(struct thread_data *td) static char *to_kmg(unsigned int val) { char *buf = malloc(32); - char post[] = { 0, 'K', 'M', 'G', 'P', -1 }; + char post[] = { 0, 'K', 'M', 'G', 'P', 0 }; char *p = post; - while (*p != -1) { + do { if (val & 1023) break; val >>= 10; p++; - } + } while (*p); snprintf(buf, 31, "%u%c", val, *p); return buf; -- 2.25.1