From 8b285f6be981e2f88cab65c19f192a6796b4267f Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 25 Jan 1995 04:32:15 +0000 Subject: [PATCH] * 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. --- src/fmt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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++) -- 2.47.3