summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-11-03 05:19:56 +0000
committerJim Meyering <jim@meyering.net>1997-11-03 05:19:56 +0000
commit65673815ac1802df9defddd0c6791b62d9f0181c (patch)
treef7116aa427c13b75823fde49367b4e69f81a5fe6 /lib
parentab5ff1597f5d734b711fbd95389cefcc8203d51c (diff)
downloadcoreutils-65673815ac1802df9defddd0c6791b62d9f0181c.tar.xz
*** empty log message ***
Diffstat (limited to 'lib')
-rw-r--r--lib/realloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/realloc.c b/lib/realloc.c
index 1f82e75aa..2a39033a7 100644
--- a/lib/realloc.c
+++ b/lib/realloc.c
@@ -28,13 +28,16 @@ char *malloc ();
char *realloc ();
/* Change the size of an allocated block of memory P to N bytes,
- with error checking. If P is NULL, use malloc. */
+ with error checking. If N is zero, change it to 1. If P is NULL,
+ use malloc. */
char *
rpl_realloc (p, n)
char *p;
size_t n;
{
+ if (n == 0)
+ n = 1;
if (p == 0)
return malloc (n);
return realloc (p, n);