From 6f41791ea677edfa9614ef8624c465d16abf0ec5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 1 Sep 2015 21:16:08 +0200 Subject: util/StringAPI: add UnsafeCopyStringP() --- src/util/WStringAPI.hxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/util/WStringAPI.hxx') diff --git a/src/util/WStringAPI.hxx b/src/util/WStringAPI.hxx index 59ee980f4..e020ecd7f 100644 --- a/src/util/WStringAPI.hxx +++ b/src/util/WStringAPI.hxx @@ -97,6 +97,19 @@ UnsafeCopyString(wchar_t *dest, const wchar_t *src) wcscpy(dest, src); } +gcc_nonnull_all +static inline wchar_t * +UnsafeCopyStringP(wchar_t *dest, const wchar_t *src) +{ +#if defined(WIN32) || defined(__BIONIC__) + /* emulate wcpcpy() */ + UnsafeCopyString(dest, src); + return dest + StringLength(dest); +#else + return wcpcpy(dest, src); +#endif +} + /** * Checks whether str1 and str2 are equal. * @param str1 String 1 -- cgit v1.2.3