]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(show_date): Use x2nrealloc rather than xrealloc.
authorJim Meyering <jim@meyering.net>
Tue, 4 Nov 2003 09:27:54 +0000 (09:27 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 4 Nov 2003 09:27:54 +0000 (09:27 +0000)
src/date.c

index 6d93338330cdac72f56caaa248e380540d90ae72..aa4b6a6134a811c1bfef47a6a5af6444f757b43b 100644 (file)
@@ -528,8 +528,7 @@ show_date (const char *format, struct timespec when)
   while (1)
     {
       int done;
-      out_length += 200;
-      out = xrealloc (out, out_length);
+      out = x2nrealloc (out, &out_length, sizeof *out);
 
       /* Mark the first byte of the buffer so we can detect the case
         of nstrftime producing an empty string.  Otherwise, this loop