summaryrefslogtreecommitdiff
path: root/nasmlib.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2010-06-03 22:04:36 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2010-06-03 23:17:21 +0400
commita73192497830167823d50ffb829f763ec270e7ef (patch)
tree397b0dd6ae437e40d055e130241d81e3676f2f2a /nasmlib.c
parent3b4e86b1ddc272cdf84f3e61486918100bb5e00f (diff)
downloadnasm-a73192497830167823d50ffb829f763ec270e7ef.tar.gz
nasmlib: Rename elements() macro to ARRAY_SIZE
ARRAY_SIZE is a well known name pointing out that we're dealing with array in macro argument. Also to be on a safe side prefix_name helper should check the index been in bounds more precisely. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'nasmlib.c')
-rw-r--r--nasmlib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nasmlib.c b/nasmlib.c
index 2ae86194..460186e6 100644
--- a/nasmlib.c
+++ b/nasmlib.c
@@ -570,7 +570,7 @@ static const char *prefix_names[] = {
const char *prefix_name(int token)
{
unsigned int prefix = token-PREFIX_ENUM_START;
- if (prefix > elements(prefix_names))
+ if (prefix >= ARRAY_SIZE(prefix_names))
return NULL;
return prefix_names[prefix];