From: Stephen M. Cameron Date: Mon, 12 Mar 2012 06:32:30 +0000 (+0100) Subject: gfio: fix tickmark shortening for zero special case X-Git-Tag: gfio-0.1~182 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=c9e8d6e3c5b5f87e17a1f4ee740f88b5b3818831 gfio: fix tickmark shortening for zero special case "0" tickmark can effectively be shortened by dividing by any number as 0 / anything is still 0, but the code was considering "0" to be unshortenable. Signed-off-by: Stephen M. Cameron Signed-off-by: Jens Axboe --- diff --git a/tickmarks.c b/tickmarks.c index 2959f026..2605f721 100644 --- a/tickmarks.c +++ b/tickmarks.c @@ -51,6 +51,8 @@ static void shorten(struct tickmark *tm, int nticks, int *power_of_ten, str = tm[i].string; l = strlen(str); + if (strcmp(str, "0") == 0) + continue; if (l > 9 && strcmp(&str[l - 9], "000000000") == 0) { *power_of_ten = 9; shorten_char = use_KMG_symbols ? 'G' : '\0';