Avoid passing negative values to isspace() on systems with signed chars.
This commit is contained in:
parent
3e019deaed
commit
80209ec51c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=132200
@ -580,7 +580,7 @@ center_stream(FILE *stream, const char *name) {
|
|||||||
size_t length;
|
size_t length;
|
||||||
while ((line=get_line(stream, &length)) != 0) {
|
while ((line=get_line(stream, &length)) != 0) {
|
||||||
size_t l=length;
|
size_t l=length;
|
||||||
while (l>0 && isspace(*line)) { ++line; --l; }
|
while (l>0 && isspace((unsigned char)*line)) { ++line; --l; }
|
||||||
length=l;
|
length=l;
|
||||||
while (l<goal_length) { putchar(' '); l+=2; }
|
while (l<goal_length) { putchar(' '); l+=2; }
|
||||||
fwrite(line, 1, length, stdout);
|
fwrite(line, 1, length, stdout);
|
||||||
|
Loading…
Reference in New Issue
Block a user