From fe3e68bab9cfbb3339eca90ebf7b0a3157e0e457 Mon Sep 17 00:00:00 2001 From: namilsk Date: Wed, 11 Feb 2026 14:44:05 +0300 Subject: Fixed warnings --- src/non_critical/_tools.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/non_critical/_tools.c') diff --git a/src/non_critical/_tools.c b/src/non_critical/_tools.c index 4b6159d..967c820 100644 --- a/src/non_critical/_tools.c +++ b/src/non_critical/_tools.c @@ -35,7 +35,15 @@ char* get_os_name() { if (end != NULL) { *end = '\0'; } - return name; + + // Allocate memory for the result and copy the string + char* result = malloc(strlen(name) + 1); + if (result != NULL) { + strcpy(result, name); + } + + fclose(file); + return result; } } -- cgit v1.2.3