From c535eb63da579deb4b0db2b761102c8a7113deae Mon Sep 17 00:00:00 2001 From: Chukobyte Date: Sun, 10 Dec 2023 22:58:36 -0500 Subject: [PATCH] Fixing se_strncpy. --- seika/utils/se_string_util.c | 4 ++-- seika/utils/se_string_util.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/seika/utils/se_string_util.c b/seika/utils/se_string_util.c index f34cec1..c4c3c2e 100644 --- a/seika/utils/se_string_util.c +++ b/seika/utils/se_string_util.c @@ -32,9 +32,9 @@ void se_strcpy(char* destination, const char* source) { strcpy(destination, source); } -void se_strncpy(char* destination, size_t sizeInBytes, const char* source) { +void se_strncpy(char* destination, size_t sizeInBytes, const char* source, size_t maxCount) { #if defined(_MSC_VER) - strncpy_s(destination, sizeInBytes, source, sizeInBytes); + strncpy_s(destination, sizeInBytes, source, maxCount); #else strncpy(destination, source, sizeInBytes); #endif diff --git a/seika/utils/se_string_util.h b/seika/utils/se_string_util.h index 0e6541a..d88318c 100644 --- a/seika/utils/se_string_util.h +++ b/seika/utils/se_string_util.h @@ -8,7 +8,7 @@ char* se_strdup(const char* string); // Copies string from a void pointer and allocated new memory char* se_strdup_from_memory(void* data, size_t size); void se_strcpy(char* destination, const char* source); -void se_strncpy(char* destination, size_t sizeInBytes, const char* source); +void se_strncpy(char* destination, size_t sizeInBytes, const char* source, size_t maxCount); void se_strcat(char* destination, const char* source); void se_strncat(char* destination, const char* source, size_t sizeInBytes); const char* se_bool_to_string(bool value);