Complete fixes for olm_*_last_error

Should have been in the previous commit :/
release-v1.0.0
Richard van der Hoff 2016-05-23 18:54:18 +01:00
parent f69577ad99
commit 182f33f8ae
1 changed files with 2 additions and 2 deletions

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