diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2009-07-15 20:40:17 +0300 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-07-31 18:12:25 +0200 |
commit | 91717f2826452cb8412d069f0980acab2ceafca9 (patch) | |
tree | 54792151c3c37b494d09e9884c20cea4c129bd89 /src | |
parent | 75b7b0fb1dda20049d8840a1319868f07d2f04be (diff) |
dso: don't assume LT_ERROR_MAX is size of table[]
Diffstat (limited to 'src')
-rw-r--r-- | src/dso.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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]; |