fix range check in olm_*_last_errror
This commit is contained in:
parent
e21d5cb222
commit
f69577ad99
1 changed files with 1 additions and 1 deletions
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue