diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-06-03 22:04:36 +0400 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-06-03 23:17:21 +0400 |
commit | a73192497830167823d50ffb829f763ec270e7ef (patch) | |
tree | 397b0dd6ae437e40d055e130241d81e3676f2f2a /nasmlib.c | |
parent | 3b4e86b1ddc272cdf84f3e61486918100bb5e00f (diff) | |
download | nasm-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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]; |