summaryrefslogtreecommitdiff
path: root/src/fmt.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-01-25 04:32:15 +0000
committerJim Meyering <jim@meyering.net>1995-01-25 04:32:15 +0000
commit8b285f6be981e2f88cab65c19f192a6796b4267f (patch)
tree3c6302f19b5a572c67cc0f262a2a0df316089251 /src/fmt.c
parent851162a0da41f2b6b08a8c1ed045086db9a443a0 (diff)
downloadcoreutils-8b285f6be981e2f88cab65c19f192a6796b4267f.tar.xz
* 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.
Diffstat (limited to 'src/fmt.c')
-rw-r--r--src/fmt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fmt.c b/src/fmt.c
index be4fe3045..91e75b6ab 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++)