From 91717f2826452cb8412d069f0980acab2ceafca9 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Wed, 15 Jul 2009 20:40:17 +0300 Subject: dso: don't assume LT_ERROR_MAX is size of table[] --- src/dso.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dso.c b/src/dso.c index 4138d0e..5dc4823 100644 --- a/src/dso.c +++ b/src/dso.c @@ -68,9 +68,12 @@ static int ca_error_from_lt_error(int code) { [LT_ERROR_CLOSE_RESIDENT_MODULE] = CA_ERROR_INTERNAL, [LT_ERROR_INVALID_MUTEX_ARGS] = CA_ERROR_INTERNAL, [LT_ERROR_INVALID_POSITION] = CA_ERROR_INTERNAL - }; +#ifdef LT_ERROR_CONFLICTING_FLAGS + , [LT_ERROR_CONFLICTING_FLAGS] = CA_ERROR_INTERNAL +#endif +}; - if (code < 0 || code >= LT_ERROR_MAX) + if (code < 0 || code >= CA_ELEMENTSOF(table)) return CA_ERROR_INTERNAL; return table[code]; -- cgit