aboutsummaryrefslogtreecommitdiff
path: root/c/util.h
diff options
context:
space:
mode:
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;