aboutsummaryrefslogtreecommitdiff
path: root/src/olm.cpp
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2016-05-23 18:54:18 +0100
committerRichard van der Hoff <richard@matrix.org>2016-05-23 18:54:18 +0100
commit182f33f8ae8c3579e098d915d00ad02bb77106fb (patch)
tree917150f5951cd1835d7de8b5267adb232f44a6c2 /src/olm.cpp
parentf69577ad99f1be21d0c1256167572366fdcb51c2 (diff)
Complete fixes for olm_*_last_error
Should have been in the previous commit :/
Diffstat (limited to 'src/olm.cpp')
-rw-r--r--src/olm.cpp4
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";