diff options
author | John Ankarström <john@ankarstrom.se> | 2022-07-31 00:38:17 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-07-31 00:38:47 +0200 |
commit | 58d30975f0d46dc7812b7266c3c2c823695503e5 (patch) | |
tree | 8eca935e6a2cc920526a09adb8d688a82feaf575 /c/common.cpp | |
parent | 7138a921143c801ef42f4190b2242ccce38ff8a1 (diff) | |
download | EpisodeBrowser-58d30975f0d46dc7812b7266c3c2c823695503e5.tar.gz |
Simplify exception handling.
Diffstat (limited to 'c/common.cpp')
-rw-r--r-- | c/common.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/c/common.cpp b/c/common.cpp index 77d669c..7ce1372 100644 --- a/c/common.cpp +++ b/c/common.cpp @@ -55,6 +55,14 @@ wstring_owner WsoFromSz(const char* const sz, const int iCp) return wsz; } +wstring_owner WsoCopy(const wchar_t* const src) +{ + const int cb = wcslen(src)+1; + wchar_t* dst = new wchar_t[cb]; + memcpy(dst, src, cb*sizeof(wchar_t)); + return dst; +} + /* Win32Error: Exception for Windows API errors. */ Win32Error::Win32Error() : dwErr(GetLastError()) {} |