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:
H. Peter Anvin 2007-11-08 19:34:01 -08:00
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];