Complete fixes for olm_*_last_error

Should have been in the previous commit :/
This commit is contained in:
Richard van der Hoff 2016-05-23 18:54:18 +01:00
parent f69577ad99
commit 182f33f8ae

View file

@ -202,7 +202,7 @@ const char * olm_session_last_error(
OlmSession * session
) {
unsigned error = unsigned(from_c(session)->last_error);
if (error < sizeof(ERRORS)) {
if (error < (sizeof(ERRORS)/sizeof(ERRORS[0]))) {
return ERRORS[error];
} else {
return "UNKNOWN_ERROR";
@ -213,7 +213,7 @@ const char * olm_utility_last_error(
OlmUtility * utility
) {
unsigned error = unsigned(from_c(utility)->last_error);
if (error < sizeof(ERRORS)) {
if (error < (sizeof(ERRORS)/sizeof(ERRORS[0]))) {
return ERRORS[error];
} else {
return "UNKNOWN_ERROR";