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
1 changed files with 1 additions and 1 deletions

2
tar.c
View File

@ -423,7 +423,7 @@ chktar(struct header *h)
goto bad;
}
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++)
if (tmp[i] == ' ')
tmp[i] = '\0';