Get size of pointer from array, not fixed type name

master
Mike Massonnet 2014-11-22 21:51:47 +01:00
parent 077ca3236e
commit 9da72fc4cc
1 changed files with 1 additions and 1 deletions

View File

@ -106,7 +106,7 @@ char* format_byte_humanreadable(char* string, int stringsize, double number, int
} }
/* calculate number and appropriate unit size for display */ /* 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; number_displayed /= thousand_divider;
uidx++; uidx++;