From 6657ea47f9421481b835994ffbc78722cc742d2d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Tue, 26 Dec 2023 11:20:03 +0100 Subject: [PATCH] readprofile: use xasprintf to build string MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Weißschuh --- sys-utils/readprofile.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sys-utils/readprofile.c b/sys-utils/readprofile.c index 3abf6c7279..6e6a68b0ca 100644 --- a/sys-utils/readprofile.c +++ b/sys-utils/readprofile.c @@ -81,14 +81,10 @@ static char *boot_uname_r_str(void) { struct utsname uname_info; char *s; - size_t len; if (uname(&uname_info)) return ""; - len = strlen(BOOT_SYSTEM_MAP) + strlen(uname_info.release) + 1; - s = xmalloc(len); - strcpy(s, BOOT_SYSTEM_MAP); - strcat(s, uname_info.release); + xasprintf(&s, "%s%s", BOOT_SYSTEM_MAP, uname_info.release); return s; } -- 2.47.2