From 4e850c55d25019a4e88fe4ae481333d05468a368 Mon Sep 17 00:00:00 2001 From: nishi Date: Mon, 26 Feb 2024 02:43:45 +0000 Subject: [PATCH] fixed __W3_Strdup issue git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@255 d27a3e52-49c5-7645-884c-6793ebffc270 --- Library/Util.c | 3 ++- W3Version.h.m4 | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Library/Util.c b/Library/Util.c index fc3fd59..8fc6c62 100644 --- a/Library/Util.c +++ b/Library/Util.c @@ -54,7 +54,8 @@ char* __W3_Concat3(const char* str1, const char* str2, const char* str3) { char* __W3_Strdup(const char* str) { char* result = malloc(strlen(str) + 1); - memcpy(result, str, strlen(str) + 1); + memcpy(result, str, strlen(str)); + result[strlen(str)] = 0; return result; } diff --git a/W3Version.h.m4 b/W3Version.h.m4 index eeaa1e1..3d47850 100644 --- a/W3Version.h.m4 +++ b/W3Version.h.m4 @@ -6,7 +6,7 @@ extern "C" { #endif -#define LIBW3_VERSION "2.19" \ +#define LIBW3_VERSION "2.19A" \ SUFFIX ifdef(`HTTP_SUPPORT', `#define LIBW3_HTTP_SUPPORT', `') -- 2.43.0