AppleWin/source/linux/stringcb.cpp
Andrea Odetti 907474c489 Add wrappers for StringCbXXXX functions and default RegLoadXXXX.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
2019-08-26 10:27:38 +01:00

16 lines
396 B
C++

#include "linux/stringcb.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;
}