From 9da72fc4cc9ba9eb2fb5ae81a42b4b765cf5694f Mon Sep 17 00:00:00 2001 From: Mike Massonnet Date: Sat, 22 Nov 2014 21:51:47 +0100 Subject: [PATCH] Get size of pointer from array, not fixed type name --- panel-plugin/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel-plugin/utils.c b/panel-plugin/utils.c index c262f87..7336034 100644 --- a/panel-plugin/utils.c +++ b/panel-plugin/utils.c @@ -106,7 +106,7 @@ char* format_byte_humanreadable(char* string, int stringsize, double number, int } /* calculate number and appropriate unit size for display */ - while(number_displayed >= thousand_divider && uidx < (sizeof(unit_names) / sizeof(char*) - 1)) + while(number_displayed >= thousand_divider && uidx < (sizeof(unit_names) / sizeof(unit_names[0]) - 1)) { number_displayed /= thousand_divider; uidx++;