AppleWin/source/linux/windows/stringcb.cpp
Andrea Odetti 7529f5c659 Reworked the entire wondows.h replacement.
wincompat.h is a stripped down version coming from linapple-pie with the bare minimum common types.
Each group of functions in its own file.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
2019-11-23 18:17:44 +00:00

16 lines
404 B
C++

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