diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-04 10:16:52 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-04 10:16:52 +0000 |
commit | 74324c86663f57a19c1de303ee8c8e5449db9ef2 (patch) | |
tree | 11f5da9de4212875ce5811be2e1050e076378c9a /coreutils/date.c | |
parent | 4e5f82c76f08614d0b69f9ec4a8baac303af15f6 (diff) | |
download | busybox-w32-74324c86663f57a19c1de303ee8c8e5449db9ef2.tar.gz busybox-w32-74324c86663f57a19c1de303ee8c8e5449db9ef2.tar.bz2 busybox-w32-74324c86663f57a19c1de303ee8c8e5449db9ef2.zip |
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.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/coreutils/date.c b/coreutils/date.c index 57c826a3f..cec8854ff 100644 --- a/coreutils/date.c +++ b/coreutils/date.c | |||
@@ -222,9 +222,10 @@ int date_main(int argc, char **argv) | |||
222 | date_fmt = (char*)"%a %b %e %H:%M:%S %Z %Y"; | 222 | date_fmt = (char*)"%a %b %e %H:%M:%S %Z %Y"; |
223 | } | 223 | } |
224 | 224 | ||
225 | #define date_buf bb_common_bufsiz1 | ||
225 | if (*date_fmt == '\0') { | 226 | if (*date_fmt == '\0') { |
226 | /* With no format string, just print a blank line */ | 227 | /* With no format string, just print a blank line */ |
227 | *bb_common_bufsiz1 = 0; | 228 | date_buf[0] = '\0'; |
228 | } else { | 229 | } else { |
229 | /* Handle special conversions */ | 230 | /* Handle special conversions */ |
230 | 231 | ||
@@ -233,9 +234,9 @@ int date_main(int argc, char **argv) | |||
233 | } | 234 | } |
234 | 235 | ||
235 | /* Generate output string */ | 236 | /* Generate output string */ |
236 | strftime(bb_common_bufsiz1, 200, date_fmt, &tm_time); | 237 | strftime(date_buf, sizeof(date_buf), date_fmt, &tm_time); |
237 | } | 238 | } |
238 | puts(bb_common_bufsiz1); | 239 | puts(date_buf); |
239 | 240 | ||
240 | return EXIT_SUCCESS; | 241 | return EXIT_SUCCESS; |
241 | } | 242 | } |