From b655c1891f7fef01e0373d9451b485ac5ae655f3 Mon Sep 17 00:00:00 2001 From: "Stephen M. Cameron" Date: Thu, 8 Mar 2012 16:57:29 +0100 Subject: [PATCH] gfio: fix a bug in the y-axis label shortening algorithm Signed-off-by: Stephen M. Cameron Signed-off-by: Jens Axboe --- tickmarks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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'; } -- 2.25.1