From 0734c043f9c0bcefa1a259d26304a1ff69cacbf0 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 29 Mar 2018 14:48:16 +0100 Subject: win32: save a few bytes In the recently-added code to pass applet names to child processes use local arrays to build the environment variables rather that allocating them every time. mingw_spawn can call mingw_spawn_proc instead of mingw_spawn_1. --- libbb/appletlib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libbb') diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 733d9ca12..ec6ad7ba8 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c @@ -993,9 +993,10 @@ void FAST_FUNC run_applet_no_and_exit(int applet_no, const char *name, char **ar #if ENABLE_PLATFORM_MINGW32 { - char *var = xasprintf("BB_APPLET_%d=%s", getpid(), applet_name); + char var[64]; + + sprintf(var, "BB_APPLET_%d=%s", getpid(), applet_name); putenv(var); - free(var); } #endif -- cgit v1.2.3-55-g6feb