fix range check in olm_*_last_errror

This commit is contained in:
Richard van der Hoff 2016-05-20 09:47:59 +01:00
parent e21d5cb222
commit f69577ad99

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