[BusyBox-cvs] svn commit: trunk/busybox/coreutils
landley at busybox.net
landley at busybox.net
Sat May 28 23:55:27 UTC 2005
Author: landley
Date: 2005-05-28 17:55:26 -0600 (Sat, 28 May 2005)
New Revision: 10435
Log:
Shaun Jackman submitted a patch converting an allocation to use
CONFIG_RESERVE_BUFFER. (Rob Landley removed an #ifdef, per discussion on
the list.)
Modified:
trunk/busybox/coreutils/date.c
Changeset:
Modified: trunk/busybox/coreutils/date.c
===================================================================
--- trunk/busybox/coreutils/date.c 2005-05-28 23:44:06 UTC (rev 10434)
+++ trunk/busybox/coreutils/date.c 2005-05-28 23:55:26 UTC (rev 10435)
@@ -136,7 +136,6 @@
{
char *date_str = NULL;
char *date_fmt = NULL;
- char *t_buff;
int set_time;
int utc;
int use_arg = 0;
@@ -283,10 +282,13 @@
date_fmt = "%Y.%m.%d-%H:%M:%S";
}
- /* Print OUTPUT (after ALL that!) */
- t_buff = xmalloc(201);
- strftime(t_buff, 200, date_fmt, &tm_time);
- puts(t_buff);
+ {
+ /* Print OUTPUT (after ALL that!) */
+ RESERVE_CONFIG_BUFFER(t_buff, 201);
+ strftime(t_buff, 200, date_fmt, &tm_time);
+ puts(t_buff);
+ RELEASE_CONFIG_BUFFER(t_buff);
+ }
return EXIT_SUCCESS;
}
More information about the busybox-cvs
mailing list