Hideki IWAMOTO writes:

Current `tr' implementation has a problem, if `plain char' is signed.

[current cvs version]

>echo a | _install/usr/bin/tr '\0' '\377'
Segmentation fault (core dumped)

[patched version]

>echo a | _install/usr/bin/tr '\0' '\377'
a
1_00_stable_10817
Eric Andersen 2004-03-12 22:10:40 +00:00
parent d20d37559f
commit ed43806c3b
1 changed files with 2 additions and 2 deletions

View File

@ -202,9 +202,9 @@ extern int tr_main(int argc, char **argv)
map(input, input_length, output, output_length);
}
for (i = 0; i < input_length; i++)
invec[(int)input[i]] = TRUE;
invec[(unsigned char)input[i]] = TRUE;
for (i = 0; i < output_length; i++)
outvec[(int)output[i]] = TRUE;
outvec[(unsigned char)output[i]] = TRUE;
}
convert();
return (0);