Use a macro to determine the size of arrays
Use following macro instead of "sizeof(x) / sizeof(x[0])" everywhere:
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
@@ -307,7 +307,7 @@ int utf8_width(char *s)
|
||||
}
|
||||
|
||||
low = 0;
|
||||
high = sizeof(utf8_widthtab) / sizeof(utf8_widthtab[0]);
|
||||
high = ARRAY_SIZE(utf8_widthtab);
|
||||
do {
|
||||
cur = (low + high) / 2;
|
||||
if (val >= utf8_widthtab[cur].min) {
|
||||
|
||||
Reference in New Issue
Block a user