diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/olm.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/olm.cpp b/src/olm.cpp index 15c5e83..4e5f215 100644 --- a/src/olm.cpp +++ b/src/olm.cpp @@ -202,7 +202,7 @@ const char * olm_session_last_error( OlmSession * session ) { unsigned error = unsigned(from_c(session)->last_error); - if (error < sizeof(ERRORS)) { + if (error < (sizeof(ERRORS)/sizeof(ERRORS[0]))) { return ERRORS[error]; } else { return "UNKNOWN_ERROR"; @@ -213,7 +213,7 @@ const char * olm_utility_last_error( OlmUtility * utility ) { unsigned error = unsigned(from_c(utility)->last_error); - if (error < sizeof(ERRORS)) { + if (error < (sizeof(ERRORS)/sizeof(ERRORS[0]))) { return ERRORS[error]; } else { return "UNKNOWN_ERROR"; |