summaryrefslogtreecommitdiff
path: root/hw/xfree86/dixmods
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2012-07-10 02:02:59 +0100
committerKeith Packard <keithp@keithp.com>2012-07-09 23:06:41 -0700
commitf48d8f58b39af0036365368d6ac35319d6d856d5 (patch)
tree04877135dbc90b5d82c957f3621a2025b68a2705 /hw/xfree86/dixmods
parentd35884da2f5a250ff6dd5131dc23ac629eccdd0c (diff)
extmod: Use ARRAY_SIZE rather than sentinel
When the array gets down to size zero (which it does in later patches), gcc complains that the index is out of bounds. Avoid this by using ARRAY_SIZE on extensionModules instead. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Stéphane Marchesin <stephane.marchesin@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw/xfree86/dixmods')
-rw-r--r--hw/xfree86/dixmods/extmod/modinit.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/hw/xfree86/dixmods/extmod/modinit.c b/hw/xfree86/dixmods/extmod/modinit.c
index afee27a59..009852c33 100644
--- a/hw/xfree86/dixmods/extmod/modinit.c
+++ b/hw/xfree86/dixmods/extmod/modinit.c
@@ -101,12 +101,6 @@ static ExtensionModule extensionModules[] = {
NULL,
NULL},
#endif
- { /* DON'T delete this entry ! */
- NULL,
- NULL,
- NULL,
- NULL,
- NULL}
};
static XF86ModuleVersionInfo VersRec = {
@@ -134,7 +128,7 @@ extmodSetup(pointer module, pointer opts, int *errmaj, int *errmin)
/* XXX the option stuff here is largely a sample/test case */
- for (i = 0; extensionModules[i].name != NULL; i++) {
+ for (i = 0; i < ARRAY_SIZE(extensionModules); i++) {
#ifdef XSELINUX
if (!strcmp(SELINUX_EXTENSION_NAME, extensionModules[i].name)) {
pointer o;