Skip to content

Commit 9d0af38

Browse files
committed
vox2fbx/voxseparate: fixed use of strcpy_s on msvc
1 parent 69ce3bd commit 9d0af38

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

apps/vox2fbx.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
------------------------------------------------------------------------------------------------------------------------------------------------- */
1919
#include <string.h>
2020
#if !_MSC_VER
21-
#define strcpy_s strncpy
2221
#define sprintf_s snprintf
2322
#endif
2423

@@ -256,7 +255,7 @@ bool write_mesh_to_fbx(const char* output_filename, const ogt_mesh* mesh, const
256255

257256
static void make_output_filename(const char* input_filename, const char* model_name, char* output_filename, size_t size) {
258257
// Copy input_filename
259-
strcpy_s(output_filename, input_filename, size);
258+
sprintf_s(output_filename, size, "%s", input_filename);
260259
output_filename[size - 1] = '\0'; // ensure null-termination
261260

262261
// Strip the extension

apps/voxseparate.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <stdio.h>
2020
#include <string.h>
2121
#if !_MSC_VER
22-
#define strcpy_s strncpy
2322
#define sprintf_s snprintf
2423
#endif
2524

@@ -105,7 +104,7 @@ void print_help() {
105104

106105
static void make_output_filename(const char* input_filename, const char* model_name, char* output_filename, size_t size) {
107106
// Copy input_filename
108-
strcpy_s(output_filename, input_filename, size);
107+
sprintf_s(output_filename, size, "%s", input_filename);
109108
output_filename[size - 1] = '\0'; // ensure null-termination
110109

111110
// Strip the extension

0 commit comments

Comments
 (0)