quirc_strerror: fix off by one error.
Bug reported by Harald Eilertsen (http://github.com/snake66/).
This commit is contained in:
parent
bdbd932b72
commit
c8b1861b8f
1 changed files with 1 additions and 1 deletions
|
@ -74,7 +74,7 @@ static const char *const error_table[] = {
|
||||||
|
|
||||||
const char *quirc_strerror(quirc_decode_error_t err)
|
const char *quirc_strerror(quirc_decode_error_t err)
|
||||||
{
|
{
|
||||||
if (err >= 0 && err <= sizeof(error_table) / sizeof(error_table[0]))
|
if (err >= 0 && err < sizeof(error_table) / sizeof(error_table[0]))
|
||||||
return error_table[err];
|
return error_table[err];
|
||||||
|
|
||||||
return "Unknown error";
|
return "Unknown error";
|
||||||
|
|
Loading…
Reference in a new issue