aboutsummaryrefslogtreecommitdiff
path: root/c/util.h
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-07 00:40:48 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-07 00:40:48 +0200
commite2d0b92ffc536c3d34ee751ba688946613bc5693 (patch)
treec944a70b4db4ed5b8ec9a440335a42fb86602972 /c/util.h
parentbea4e9f8740c1bf3ebe80d95ab6e749cfb5de605 (diff)
downloadEpisodeBrowser-e2d0b92ffc536c3d34ee751ba688946613bc5693.tar.gz
Add Strcpy.
Diffstat (limited to 'c/util.h')
-rw-r--r--c/util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/c/util.h b/c/util.h
index 11840fa..51fd020 100644
--- a/c/util.h
+++ b/c/util.h
@@ -10,6 +10,13 @@ inline int Swprintf(wchar_t (&buf)[N], const wchar_t* const fmt, T... xs)
return _snwprintf_s(buf, N, _TRUNCATE, fmt, xs...);
}
+/* Copy to static narrow string buffer. */
+template <size_t N>
+inline int Strcpy(char (&dst)[N], const char* const src)
+{
+ return strcpy_s(dst, N, src);
+}
+
inline int Cmp(const int a, const int b)
{
if (a == b) return 0;