diff --git a/usr.bin/shuffle/shuffle.c b/usr.bin/shuffle/shuffle.c index 0060f7d99c25..f0b3d793eec1 100644 --- a/usr.bin/shuffle/shuffle.c +++ b/usr.bin/shuffle/shuffle.c @@ -1,4 +1,4 @@ -/* $NetBSD: shuffle.c,v 1.8 2001/02/19 23:03:51 cgd Exp $ */ +/* $NetBSD: shuffle.c,v 1.9 2001/03/16 08:02:32 mycroft Exp $ */ /* * Copyright (c) 1998 @@ -33,7 +33,7 @@ #include #ifndef lint -__RCSID("$NetBSD: shuffle.c,v 1.8 2001/02/19 23:03:51 cgd Exp $"); +__RCSID("$NetBSD: shuffle.c,v 1.9 2001/03/16 08:02:32 mycroft Exp $"); #endif /* not lint */ #include @@ -152,7 +152,7 @@ get_lines(fname, linesp, nlinesp) { FILE *fp; char *line; - size_t size, nlines = 0, maxlines = 100; + size_t size, nlines = 0, maxlines = 128; char **lines = emalloc(sizeof(char *) * maxlines); if (strcmp(fname, "-") == 0) @@ -168,7 +168,7 @@ get_lines(fname, linesp, nlinesp) (void)memcpy(lines[nlines], line, size); lines[nlines++][size] = '\0'; if (nlines >= maxlines) { - maxlines += 100; + maxlines *= 2; lines = erealloc(lines, (sizeof(char *) * maxlines)); } }