scrut(1): fix syntax error

This commit is contained in:
dtb 2024-07-19 19:34:37 -06:00
parent 19eee6b4e5
commit f96ed9c1f3
Signed by: trinity
GPG Key ID: 34C0543BBB6AF81B

View File

@ -48,8 +48,9 @@ int main(int argc, char *argv[]) {
else { sel[p - args] = c; } else { sel[p - args] = c; }
} }
/* straighten out selections */ /* straighten out selections; permute out nulls */
for (size_t i = 0, p = sel; i < (sizeof sel) / (sizeof *sel); ++i) { p = sel;
for (size_t i = 0; i < (sizeof sel) / (sizeof *sel); ++i) {
if (sel[i] != '\0') { if (sel[i] != '\0') {
*p = sel[i]; *p = sel[i];
if (&sel[i] != p++) { sel[i] = '\0'; } if (&sel[i] != p++) { sel[i] = '\0'; }