summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--text-utils/more.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/text-utils/more.c b/text-utils/more.c
index 3bbeede5d..33771183c 100644
--- a/text-utils/more.c
+++ b/text-utils/more.c
@@ -835,7 +835,8 @@ void prepare_line_buffer(void)
if (nsz < LINSIZ)
nsz = LINSIZ;
- nline = xrealloc(Line, nsz);
+ /* alloc nsz and extra space for \n\0 */
+ nline = xrealloc(Line, nsz + 2);
Line = nline;
LineLen = nsz;
}