From 59f5aeeec5f8f962cb4447fb2a6d401b5f6ef2d3 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Fri, 8 Nov 2013 21:18:23 +0100 Subject: [PATCH] util: Use the macro 'wlengthof' to get the number of element in an array The new macro 'wlengthof' from WUtil makes code easier to read than the previous [sizeof() / sizeof([0]) ] construct. Signed-off-by: Christophe CURIS --- util/fontconv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/fontconv.c b/util/fontconv.c index 31dde467..82765214 100644 --- a/util/fontconv.c +++ b/util/fontconv.c @@ -108,7 +108,7 @@ static char *mapWeightToName(str * weight) if (weight->len == 0) return ""; - for (i = 0; i < sizeof(normalNames) / sizeof(normalNames[0]); i++) { + for (i = 0; i < wlengthof(normalNames); i++) { if (strlen(normalNames[i]) == weight->len && strncmp(normalNames[i], weight->str, weight->len)) { return ""; }