tools: fix begin check index and access by array

This excludes accessing to array by non-valid index.
This commit is contained in:
GermanAizek 2025-08-23 00:02:56 +03:00
parent 8c1e83deaa
commit 7095e15097
No known key found for this signature in database
GPG key ID: 1D2DC7BDC7225EF7

View file

@ -134,8 +134,8 @@ print_ay (DBusMessageIter *iter, int depth)
for (i = 0; i < len; i++)
{
if ((bytes[i] < 32 || bytes[i] > 126) &&
(i < len - 1 || bytes[i] != '\0'))
if ((i < len - 1 || bytes[i] != '\0') &&
(bytes[i] < 32 || bytes[i] > 126))
{
all_ascii = FALSE;
break;