quirc_strerror: fix off by one error.

Bug reported by Harald Eilertsen (http://github.com/snake66/).
This commit is contained in:
Daniel Beer 2013-02-02 18:04:49 +13:00
parent bdbd932b72
commit c8b1861b8f

View file

@ -74,7 +74,7 @@ static const char *const error_table[] = {
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 "Unknown error";