]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
* fmt.c (copy_rest): Replace `||' with `&&'. Before, a paragraph
authorJim Meyering <jim@meyering.net>
Wed, 25 Jan 1995 04:32:15 +0000 (04:32 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 25 Jan 1995 04:32:15 +0000 (04:32 +0000)
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

index be4fe30451f92c94e679c1b918871f9fe348e8ff..91e75b6ab74c193941bec2178b1e2c7ae8f2d511 100644 (file)
--- 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++)