From fddd93edbdbf8c5afbfdb3c01d82e082a8a82d1a Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 5 Feb 2026 13:36:27 +0100 Subject: libbb: introduce and use xasprintf_inplace() function old new delta xasprintf_and_free - 49 +49 watch_main 269 282 +13 singlemount 1313 1315 +2 append_mount_options 157 149 -8 ip_port_str 122 112 -10 lsblk_main 869 858 -11 add_cmd 1178 1167 -11 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/4 up/down: 64/-40) Total: 24 bytes Signed-off-by: Denys Vlasenko --- modutils/modprobe-small.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'modutils') diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c index 31a215a29..b3c0768ee 100644 --- a/modutils/modprobe-small.c +++ b/modutils/modprobe-small.c @@ -1010,9 +1010,7 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv) char **arg = argv; while (*++arg) { /* Enclose options in quotes */ - char *s = options; - options = xasprintf("%s \"%s\"", s ? s : "", *arg); - free(s); + xasprintf_inplace(options, "%s \"%s\"", options ? options : "", *arg); *arg = NULL; } # else -- cgit v1.2.3-55-g6feb