summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/csplit.c2
-rw-r--r--src/unexpand.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/csplit.c b/src/csplit.c
index 54bd498d7..ad13b2645 100644
--- a/src/csplit.c
+++ b/src/csplit.c
@@ -609,7 +609,7 @@ load_buffer ()
b->bytes_used += (unsigned) read_input (p, bytes_avail);
lines_found = record_line_starts (b);
- bytes_wanted = b->bytes_alloc + INCR_SIZE;
+ bytes_wanted = b->bytes_alloc * 2;
if (!lines_found)
free_buffer (b);
}
diff --git a/src/unexpand.c b/src/unexpand.c
index 12762e354..6c3a52776 100644
--- a/src/unexpand.c
+++ b/src/unexpand.c
@@ -282,6 +282,9 @@ unexpand ()
int pending = 0; /* Pending columns of blanks. */
fp = next_file ((FILE *) NULL);
+ if (fp == NULL)
+ return;
+
for (;;)
{
c = getc (fp);