summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-11-08 19:34:01 -0800
committerH. Peter Anvin <hpa@zytor.com>2007-11-08 19:34:01 -0800
commit52bd38b899ed03dee25aea931c0908354b4ae6a6 (patch)
treebf11a841dc9ea01759e50a76a5fdaa784303ece4
parent6a6eafdcee2f454eb6680b5919b9365bb2e827f0 (diff)
downloadnasm-52bd38b899ed03dee25aea931c0908354b4ae6a6.tar.gz
nasmlib.c: prefix_name(): use the elements() macro
Use the elements() macro to count the elements in a static array.
-rw-r--r--nasmlib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nasmlib.c b/nasmlib.c
index 44e3a36e..170c95fe 100644
--- a/nasmlib.c
+++ b/nasmlib.c
@@ -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];