From 1525fae2c195fa4246044b37ce89ae38696cae18 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 28 Apr 2025 12:03:23 +0600 Subject: [PATCH] Test fix for yon_char_append --- source/libublsettings-char.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/source/libublsettings-char.c b/source/libublsettings-char.c index 770e53d..0056d34 100644 --- a/source/libublsettings-char.c +++ b/source/libublsettings-char.c @@ -12,14 +12,10 @@ char *yon_char_append(const char *source, const char *append) { if (source && append) { - int source_size = strlen(source); - int append_size = strlen(append); - int size = source_size + append_size + 1; + int size = strlen(source) + strlen(append) + 1; char *final = malloc(size); memset(final, 0, size); - memcpy(final,source,source_size); - memcpy(final+source_size,append,append_size); - // sprintf(final, "%s%s", source, append); + sprintf(final, "%s%s", source, append); return final; } return NULL;