summaryrefslogtreecommitdiff
path: root/busybox/coreutils/date.c
diff options
context:
space:
mode:
authorEric Andersen2005-07-18 23:51:27 +0000
committerEric Andersen2005-07-18 23:51:27 +0000
commit164a716f964bba247c660bc70149234f95146871 (patch)
tree95a8a6f75cb2ed1bb07cb6019088db7348ebf4d4 /busybox/coreutils/date.c
parent8c59a0bf0e9e2d87b0ff273ea3f0bf05bbbf6373 (diff)
downloadbusybox-164a716f964bba247c660bc70149234f95146871.zip
busybox-164a716f964bba247c660bc70149234f95146871.tar.gz
busybox-1.0.1-rc1.patch
http://busybox.net/lists/busybox/2005-July/014974.html
Diffstat (limited to 'busybox/coreutils/date.c')
-rw-r--r--busybox/coreutils/date.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/busybox/coreutils/date.c b/busybox/coreutils/date.c
index 3608df6..70484e2 100644
--- a/busybox/coreutils/date.c
+++ b/busybox/coreutils/date.c
@@ -136,7 +136,6 @@ int date_main(int argc, char **argv)
{
char *date_str = NULL;
char *date_fmt = NULL;
- char *t_buff;
int set_time;
int utc;
int use_arg = 0;
@@ -166,7 +165,7 @@ int date_main(int argc, char **argv)
bb_error_msg_and_die(bb_msg_memory_exhausted);
}
use_arg = opt & DATE_OPT_DATE;
- if(opt & 0x80000000UL)
+ if(opt & BB_GETOPT_ERROR)
bb_show_usage();
#ifdef CONFIG_FEATURE_DATE_ISOFMT
if(opt & DATE_OPT_TIMESPEC) {
@@ -283,10 +282,13 @@ int date_main(int argc, char **argv)
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;
}