diff options
author | Richard van der Hoff <richard@matrix.org> | 2016-05-23 18:54:18 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2016-05-23 18:54:18 +0100 |
commit | 182f33f8ae8c3579e098d915d00ad02bb77106fb (patch) | |
tree | 917150f5951cd1835d7de8b5267adb232f44a6c2 /src | |
parent | f69577ad99f1be21d0c1256167572366fdcb51c2 (diff) |
Complete fixes for olm_*_last_error
Should have been in the previous commit :/
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"; |