eizoctl: more careful data handling

This commit is contained in:
Přemysl Eric Janouch 2024-11-26 02:57:15 +01:00
parent c3f20ee473
commit ef82918f78
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -950,7 +950,7 @@ eizo_watch(struct eizo_monitor *m)
continue;
}
if (r->report_size == 16)
for (size_t i = 0; i < rlen; i += 2)
for (size_t i = 0; i + 1 < rlen; i += 2)
printf(" %04x", peek_u16le(&buf[7 + i]));
else
for (size_t i = 0; i < rlen; i++)