Resolve type conflict

This commit is contained in:
Nesterov Alexander 2020-05-20 18:05:21 +03:00
parent b7253e3280
commit 735c31bb4a

View File

@ -27,10 +27,7 @@ struct quirc *quirc_new(void)
{
struct quirc *q = malloc(sizeof(*q));
if (!q)
return NULL;
memset(q, 0, sizeof(*q));
memset(q, 0, sizeof(*q));
return q;
}
@ -123,8 +120,10 @@ static const char *const error_table[] = {
const char *quirc_strerror(quirc_decode_error_t err)
{
if ((int)err >= 0 && (int)err < sizeof(error_table) / sizeof(error_table[0]))
return error_table[err];
if ((int) err >= 0) {
if ((unsigned long) err < (unsigned long) (sizeof(error_table) / sizeof(error_table[0])))
return error_table[err];
}
return "Unknown error";
return "Unknown error";
}