1
0
mirror of git://git.suckless.org/sbase synced 2025-01-03 05:22:16 +00:00

tar: chktar: fix conditional typo

This commit is contained in:
Elie Le Vaillant 2024-03-05 21:20:57 +01:00 committed by Roberto E. Vargas Caballero
parent bca3fcca91
commit 13898fa7a9

2
tar.c
View File

@ -423,7 +423,7 @@ chktar(struct header *h)
goto bad; goto bad;
} }
memcpy(tmp, h->chksum, sizeof(tmp)); memcpy(tmp, h->chksum, sizeof(tmp));
for (i = 0; i < sizeof(tmp), tmp[i] == ' '; i++); for (i = 0; i < sizeof(tmp) && tmp[i] == ' '; i++);
for (; i < sizeof(tmp); i++) for (; i < sizeof(tmp); i++)
if (tmp[i] == ' ') if (tmp[i] == ' ')
tmp[i] = '\0'; tmp[i] = '\0';