Complete fixes for olm_*_last_error
Should have been in the previous commit :/
This commit is contained in:
parent
f69577ad99
commit
182f33f8ae
1 changed files with 2 additions and 2 deletions
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue