diff options
author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-05-28 23:55:26 +0000 |
---|---|---|
committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-05-28 23:55:26 +0000 |
commit | d412110b2e9e15ed7ff9437e776986d472508b9b (patch) | |
tree | a6868ca1960702b7dfbe1e9a7db9d0b597a0f6d7 | |
parent | f132923b980b5aae9519edc42a4362d2361fa1e4 (diff) | |
download | busybox-w32-d412110b2e9e15ed7ff9437e776986d472508b9b.tar.gz busybox-w32-d412110b2e9e15ed7ff9437e776986d472508b9b.tar.bz2 busybox-w32-d412110b2e9e15ed7ff9437e776986d472508b9b.zip |
Shaun Jackman submitted a patch converting an allocation to use
CONFIG_RESERVE_BUFFER. (Rob Landley removed an #ifdef, per discussion on
the list.)
git-svn-id: svn://busybox.net/trunk/busybox@10435 69ca8d6d-28ef-0310-b511-8ec308f3f277
-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 513aadeec..70484e2cd 100644 --- a/coreutils/date.c +++ b/coreutils/date.c | |||
@@ -136,7 +136,6 @@ int date_main(int argc, char **argv) | |||
136 | { | 136 | { |
137 | char *date_str = NULL; | 137 | char *date_str = NULL; |
138 | char *date_fmt = NULL; | 138 | char *date_fmt = NULL; |
139 | char *t_buff; | ||
140 | int set_time; | 139 | int set_time; |
141 | int utc; | 140 | int utc; |
142 | int use_arg = 0; | 141 | int use_arg = 0; |
@@ -283,10 +282,13 @@ int date_main(int argc, char **argv) | |||
283 | date_fmt = "%Y.%m.%d-%H:%M:%S"; | 282 | date_fmt = "%Y.%m.%d-%H:%M:%S"; |
284 | } | 283 | } |
285 | 284 | ||
286 | /* Print OUTPUT (after ALL that!) */ | 285 | { |
287 | t_buff = xmalloc(201); | 286 | /* Print OUTPUT (after ALL that!) */ |
288 | strftime(t_buff, 200, date_fmt, &tm_time); | 287 | RESERVE_CONFIG_BUFFER(t_buff, 201); |
289 | puts(t_buff); | 288 | strftime(t_buff, 200, date_fmt, &tm_time); |
289 | puts(t_buff); | ||
290 | RELEASE_CONFIG_BUFFER(t_buff); | ||
291 | } | ||
290 | 292 | ||
291 | return EXIT_SUCCESS; | 293 | return EXIT_SUCCESS; |
292 | } | 294 | } |