aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2016-05-20 09:47:59 +0100
committerRichard van der Hoff <richard@matrix.org>2016-05-23 18:53:14 +0100
commitf69577ad99f1be21d0c1256167572366fdcb51c2 (patch)
tree6130b4347779cfb04495e9d899b255e9fb7f3e63
parente21d5cb2229c8c868fad896c08e7c25c103b824a (diff)
fix range check in olm_*_last_errror
-rw-r--r--src/olm.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/olm.cpp b/src/olm.cpp
index 63f3d83..15c5e83 100644
--- a/src/olm.cpp
+++ b/src/olm.cpp
@@ -190,7 +190,7 @@ const char * olm_account_last_error(
OlmAccount * account
) {
unsigned error = unsigned(from_c(account)->last_error);
- if (error < sizeof(ERRORS)) {
+ if (error < (sizeof(ERRORS)/sizeof(ERRORS[0]))) {
return ERRORS[error];
} else {
return "UNKNOWN_ERROR";