Skip to content

Commit

Permalink
Fixing se_strncpy.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chukobyte committed Dec 11, 2023
1 parent e4dde31 commit c535eb6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions seika/utils/se_string_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion seika/utils/se_string_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c535eb6

Please sign in to comment.