From e2d0b92ffc536c3d34ee751ba688946613bc5693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 7 Aug 2022 00:40:48 +0200 Subject: Add Strcpy. --- c/util.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'c/util.h') 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 +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; -- cgit v1.2.3