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:
committed by
Carlos R. Mafra
parent
a3b6b62049
commit
be022d9623
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user