summaryrefslogtreecommitdiff
path: root/coreutils/date.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-06-04 10:16:52 +0000
committerDenis Vlasenko2007-06-04 10:16:52 +0000
commit74324c86663f57a19c1de303ee8c8e5449db9ef2 (patch)
tree11f5da9de4212875ce5811be2e1050e076378c9a /coreutils/date.c
parent4e5f82c76f08614d0b69f9ec4a8baac303af15f6 (diff)
downloadbusybox-74324c86663f57a19c1de303ee8c8e5449db9ef2.zip
busybox-74324c86663f57a19c1de303ee8c8e5449db9ef2.tar.gz
Audit bb_common_bufsiz usage, add script which looks for misuse.
tr: stop using globals needlessly. code: -103 bytes
Diffstat (limited to 'coreutils/date.c')
-rw-r--r--coreutils/date.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/coreutils/date.c b/coreutils/date.c
index 57c826a..cec8854 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -222,9 +222,10 @@ int date_main(int argc, char **argv)
date_fmt = (char*)"%a %b %e %H:%M:%S %Z %Y";
}
+#define date_buf bb_common_bufsiz1
if (*date_fmt == '\0') {
/* With no format string, just print a blank line */
- *bb_common_bufsiz1 = 0;
+ date_buf[0] = '\0';
} else {
/* Handle special conversions */
@@ -233,9 +234,9 @@ int date_main(int argc, char **argv)
}
/* Generate output string */
- strftime(bb_common_bufsiz1, 200, date_fmt, &tm_time);
+ strftime(date_buf, sizeof(date_buf), date_fmt, &tm_time);
}
- puts(bb_common_bufsiz1);
+ puts(date_buf);
return EXIT_SUCCESS;
}