From: Jim Meyering Date: Wed, 25 Jan 1995 04:32:15 +0000 (+0000) Subject: * fmt.c (copy_rest): Replace `||' with `&&'. Before, a paragraph X-Git-Tag: textutils-1_12_1~340 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8b285f6be981e2f88cab65c19f192a6796b4267f;p=thirdparty%2Fcoreutils.git * fmt.c (copy_rest): Replace `||' with `&&'. Before, a paragraph not followed by a newline would be followed by data copied from uninitialized storage. Repeat by `printf abc|fmt|od -ac'. Reported by Franc,ois Pinard. --- diff --git a/src/fmt.c b/src/fmt.c index be4fe30451..91e75b6ab7 100644 --- a/src/fmt.c +++ b/src/fmt.c @@ -545,7 +545,7 @@ get_paragraph (f) return TRUE; } -/* Copy a line which failed to match the prefix to the output, or which +/* Copy to the output a line that failed to match the prefix, or that was blank after the prefix. In the former case, C is the character that failed to match the prefix. In the latter, C is \n or EOF. Return the character (\n or EOF) ending the line. */ @@ -558,7 +558,7 @@ copy_rest (f, c) register const char *s; out_column = 0; - if (in_column > next_prefix_indent || (c != '\n' && c != EOF)) + if (in_column > next_prefix_indent && c != '\n' && c != EOF) { put_space (next_prefix_indent); for (s = prefix; out_column != in_column; out_column++)