diff options
author | Rob Landley | 2005-05-28 23:55:26 +0000 |
---|---|---|
committer | Rob Landley | 2005-05-28 23:55:26 +0000 |
commit | f7662da2af1b6a9982ca0b2c8186dd1893d8c292 (patch) | |
tree | a6868ca1960702b7dfbe1e9a7db9d0b597a0f6d7 /coreutils/date.c | |
parent | 47bc802e9e8942182cd3cec1b5a6c3fb62427d16 (diff) | |
download | busybox-f7662da2af1b6a9982ca0b2c8186dd1893d8c292.zip busybox-f7662da2af1b6a9982ca0b2c8186dd1893d8c292.tar.gz |
Shaun Jackman submitted a patch converting an allocation to use
CONFIG_RESERVE_BUFFER. (Rob Landley removed an #ifdef, per discussion on
the list.)
Diffstat (limited to 'coreutils/date.c')
-rw-r--r-- | coreutils/date.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/coreutils/date.c b/coreutils/date.c index 513aade..70484e2 100644 --- a/coreutils/date.c +++ b/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; @@ -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; } |