From e1f73b64dcf047c9794f3546e3dc1b041a3660a6 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Tue, 9 Apr 2024 09:09:28 +0100 Subject: time: code shrink Commit 54dbf0fa5 (time: mitigation for interleaved output) added buffering to stderr in the 'time' applet. @avih pointed out that it isn't necessary to provide an explicit buffer. Saves 16 bytes in the 64-bit build. (GitHub issue #396) --- miscutils/time.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/miscutils/time.c b/miscutils/time.c index 09a474979..9a1039be9 100644 --- a/miscutils/time.c +++ b/miscutils/time.c @@ -471,9 +471,6 @@ int time_main(int argc UNUSED_PARAM, char **argv) /* $TIME has lowest prio (-v,-p,-f FMT override it) */ const char *output_format = getenv("TIME") ? : default_format; char *output_filename; -#if ENABLE_PLATFORM_MINGW32 - char buffer[256]; -#endif int output_fd; int opt; int ex; @@ -528,7 +525,7 @@ int time_main(int argc UNUSED_PARAM, char **argv) /* Cheat. printf's are shorter :) */ xdup2(output_fd, STDOUT_FILENO); #if ENABLE_PLATFORM_MINGW32 - setvbuf(stdout, buffer, _IOFBF, sizeof(buffer)); + setvbuf(stdout, NULL, _IOFBF, 256); #endif summarize(output_format, argv, &res); -- cgit v1.2.3-55-g6feb