1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

wmaker: 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 <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2013-11-08 21:18:21 +01:00
committed by Carlos R. Mafra
parent a3b6b62049
commit be022d9623
5 changed files with 22 additions and 24 deletions

View File

@@ -168,7 +168,7 @@ void FormatXError(Display * dpy, XErrorEvent * error, char *buffer, int size)
if (i > size - 100)
return;
buffer += i;
if (error->request_code >= sizeof(requestCodes) / sizeof(requestCodes[0])) {
if (error->request_code >= wlengthof(requestCodes)) {
sprintf(buffer, "\n Request code: %i\n", error->request_code);
} else {
sprintf(buffer, "\n Request code: %i %s\n", error->request_code,