fix range check in olm_*_last_errror

release-v1.0.0
Richard van der Hoff 2016-05-20 09:47:59 +01:00
parent e21d5cb222
commit f69577ad99
1 changed files with 1 additions and 1 deletions

View File

@ -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";