aboutsummaryrefslogtreecommitdiffstats
path: root/src/utf8.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2013-05-04 17:11:33 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2013-05-04 20:32:26 +0200
commitce93fa8adbeb31d160cba198e50e3f828e8def50 (patch)
tree8380e143ab3fec663f284a9e6d958996c2561b75 /src/utf8.c
parent370c4031be9c921ae54ccb7cafff71d0a2c9b790 (diff)
downloadcalcurse-ce93fa8adbeb31d160cba198e50e3f828e8def50.tar.gz
calcurse-ce93fa8adbeb31d160cba198e50e3f828e8def50.zip
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>
Diffstat (limited to 'src/utf8.c')
-rw-r--r--src/utf8.c2
1 files changed, 1 insertions, 1 deletions
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) {