util/StringAPI: add UnsafeCopyStringP()
This commit is contained in:
parent
0bacbcd04e
commit
6f41791ea6
@ -101,6 +101,19 @@ UnsafeCopyString(char *dest, const char *src)
|
||||
strcpy(dest, src);
|
||||
}
|
||||
|
||||
gcc_nonnull_all
|
||||
static inline char *
|
||||
UnsafeCopyStringP(char *dest, const char *src)
|
||||
{
|
||||
#if defined(WIN32) || defined(__BIONIC__)
|
||||
/* emulate stpcpy() */
|
||||
UnsafeCopyString(dest, src);
|
||||
return dest + StringLength(dest);
|
||||
#else
|
||||
return stpcpy(dest, src);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether #a and #b are equal.
|
||||
*/
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user