From 8116c7bd4247f28583cf05eab6d733f9fa5544d9 Mon Sep 17 00:00:00 2001 From: oparviai Date: Sun, 12 Dec 2010 19:12:12 +0000 Subject: [PATCH] Replaced proprietary strcpy_s with ansi-compatible strncpy --- source/SoundTouchDLL/SoundTouchDLL.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/SoundTouchDLL/SoundTouchDLL.cpp b/source/SoundTouchDLL/SoundTouchDLL.cpp index aa3c012..bd6967e 100644 --- a/source/SoundTouchDLL/SoundTouchDLL.cpp +++ b/source/SoundTouchDLL/SoundTouchDLL.cpp @@ -35,6 +35,7 @@ //////////////////////////////////////////////////////////////////////////////// #include +#include #include "SoundTouchDLL.h" #include "soundtouch.h" @@ -112,7 +113,8 @@ SOUNDTOUCHDLL_API const char *__stdcall soundtouch_getVersionString() /// environments that can't properly handle character string as return value SOUNDTOUCHDLL_API void __stdcall soundtouch_getVersionString2(char* versionString, int bufferSize) { - strcpy_s(versionString, bufferSize, SoundTouch::getVersionString()); + strncpy(versionString, SoundTouch::getVersionString(), bufferSize - 1); + versionString[bufferSize - 1] = 0; }