From: Stephen M. Cameron Date: Thu, 8 Mar 2012 15:57:29 +0000 (+0100) Subject: gfio: fix a bug in the y-axis label shortening algorithm X-Git-Tag: gfio-0.1~215 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=b655c1891f7fef01e0373d9451b485ac5ae655f3 gfio: fix a bug in the y-axis label shortening algorithm Signed-off-by: Stephen M. Cameron Signed-off-by: Jens Axboe --- diff --git a/tickmarks.c b/tickmarks.c index c99f5cd5..21f77da0 100644 --- a/tickmarks.c +++ b/tickmarks.c @@ -47,10 +47,10 @@ static void shorten(char *str) if (l > 9 && strcmp(&str[l - 9], "000000000") == 0) { str[l - 9] = 'G'; str[l - 8] = '\0'; - } else if (l > 9 && strcmp(&str[l - 6], "000000") == 0) { + } else if (l > 6 && strcmp(&str[l - 6], "000000") == 0) { str[l - 6] = 'M'; str[l - 5] = '\0'; - } else if (l > 9 && strcmp(&str[l - 3], "000") == 0) { + } else if (l > 3 && strcmp(&str[l - 3], "000") == 0) { str[l - 3] = 'K'; str[l - 2] = '\0'; }