diff options
author | Richard van der Hoff <richard@matrix.org> | 2016-05-20 09:47:59 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2016-05-23 18:53:14 +0100 |
commit | f69577ad99f1be21d0c1256167572366fdcb51c2 (patch) | |
tree | 6130b4347779cfb04495e9d899b255e9fb7f3e63 /src/olm.cpp | |
parent | e21d5cb2229c8c868fad896c08e7c25c103b824a (diff) |
fix range check in olm_*_last_errror
Diffstat (limited to 'src/olm.cpp')
-rw-r--r-- | src/olm.cpp | 2 |
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"; |