AppleWin/source/linux/libwindows/strsafe.cpp
Andrea Odetti 76317c2df1 libwindows: a very tiny step towards compilation of libretro with VS.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
2021-11-28 18:49:17 +00:00

16 lines
389 B
C++

#include "strsafe.h"
#include <cstring>
HRESULT StringCbCopy(char * pszDest, const size_t cbDest, const char * pszSrc)
{
strncpy(pszDest, pszSrc, cbDest - 1);
pszDest[cbDest - 1] = '\0';
return 0;
}
HRESULT StringCbCat(char * pszDest, const size_t cbDest, const char * pszSrc)
{
strncat(pszDest, pszSrc, cbDest - strlen(pszDest) - 1);
pszDest[cbDest - 1] = '\0';
return 0;
}