aboutsummaryrefslogtreecommitdiff
path: root/coreutils/date.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/date.c')
-rw-r--r--coreutils/date.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/coreutils/date.c b/coreutils/date.c
index 7965775fe..ff3214d85 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -138,6 +138,7 @@
138//usage: "Wed Apr 12 18:52:41 MDT 2000\n" 138//usage: "Wed Apr 12 18:52:41 MDT 2000\n"
139 139
140#include "libbb.h" 140#include "libbb.h"
141#include "common_bufsiz.h"
141#if ENABLE_FEATURE_DATE_NANO 142#if ENABLE_FEATURE_DATE_NANO
142# include <sys/syscall.h> 143# include <sys/syscall.h>
143#endif 144#endif
@@ -368,6 +369,7 @@ int date_main(int argc UNUSED_PARAM, char **argv)
368#endif 369#endif
369 370
370#define date_buf bb_common_bufsiz1 371#define date_buf bb_common_bufsiz1
372 setup_common_bufsiz();
371 if (*fmt_dt2str == '\0') { 373 if (*fmt_dt2str == '\0') {
372 /* With no format string, just print a blank line */ 374 /* With no format string, just print a blank line */
373 date_buf[0] = '\0'; 375 date_buf[0] = '\0';
@@ -377,7 +379,7 @@ int date_main(int argc UNUSED_PARAM, char **argv)
377 fmt_dt2str = (char*)"%Y.%m.%d-%H:%M:%S"; 379 fmt_dt2str = (char*)"%Y.%m.%d-%H:%M:%S";
378 } 380 }
379 /* Generate output string */ 381 /* Generate output string */
380 strftime(date_buf, sizeof(date_buf), fmt_dt2str, &tm_time); 382 strftime(date_buf, COMMON_BUFSIZE, fmt_dt2str, &tm_time);
381 } 383 }
382 puts(date_buf); 384 puts(date_buf);
383 385