summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-09-15 03:23:12 +0000
committerJim Meyering <jim@meyering.net>1997-09-15 03:23:12 +0000
commit6d77a9d346bf5e2d516443bbc21468c20b2c6e38 (patch)
tree30ba3e445f7a63ba332fa1e465d85fd411c7aa3f /src
parentf5be07c5c72c98c3f32c59b8c669e0c4c8f2fb8c (diff)
downloadcoreutils-6d77a9d346bf5e2d516443bbc21468c20b2c6e38.tar.xz
(full_filename): Use realloc, not xrealloc.
Diffstat (limited to 'src')
-rw-r--r--src/rm.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/rm.c b/src/rm.c
index dd8316931..0ef0798ba 100644
--- a/src/rm.c
+++ b/src/rm.c
@@ -102,6 +102,7 @@ struct File_spec
#ifndef STDC_HEADERS
void free ();
char *malloc ();
+char *realloc ();
#endif
char *base_name ();
@@ -110,7 +111,6 @@ char *stpcpy ();
char *stpncpy ();
void strip_trailing_slashes ();
char *xmalloc ();
-char *xrealloc ();
int yesno ();
/* Forward dcl for recursively called function. */
@@ -381,14 +381,12 @@ full_filename (const char *filename)
if (n_bytes_needed > n_allocated)
{
- /* FIXME: use realloc, not xrealloc. */
- /* But be sure realloc accepts NULL first arg.
- FIXME: replace with rpl_realloc if not. */
- /* This funciton can't use xrealloc. Otherwise, out-of-memory
+ /* This code requires that realloc accept NULL as the first arg.
+ This function cannot use xrealloc. Otherwise, out-of-memory
errors involving a file name to be expanded here wouldn't ever
be issued. Use realloc and fall back on using a static buffer
- if memory is a problem. */
- buf = xrealloc (buf, n_bytes_needed);
+ if memory allocation fails. */
+ buf = realloc (buf, n_bytes_needed);
n_allocated = n_bytes_needed;
if (buf == NULL)