From ce93fa8adbeb31d160cba198e50e3f828e8def50 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sat, 4 May 2013 17:11:33 +0200 Subject: 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 --- src/utf8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/utf8.c') diff --git a/src/utf8.c b/src/utf8.c index 9b9f341..723c121 100644 --- a/src/utf8.c +++ b/src/utf8.c @@ -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) { -- cgit v1.2.3-54-g00ecf