mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-04-12 18:40:23 +08:00
nasmlib.c: prefix_name(): use the elements() macro
Use the elements() macro to count the elements in a static array.
This commit is contained in:
parent
6a6eafdcee
commit
52bd38b899
@ -776,7 +776,7 @@ static const char *prefix_names[] = {
|
||||
const char *prefix_name(int token)
|
||||
{
|
||||
unsigned int prefix = token-PREFIX_ENUM_START;
|
||||
if (prefix > sizeof prefix_names / sizeof(const char *))
|
||||
if (prefix > elements(prefix_names))
|
||||
return NULL;
|
||||
|
||||
return prefix_names[prefix];
|
||||
|
Loading…
x
Reference in New Issue
Block a user