summaryrefslogtreecommitdiff
path: root/ustring.c
diff options
context:
space:
mode:
Diffstat (limited to 'ustring.c')
-rw-r--r--ustring.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ustring.c b/ustring.c
index 0e3bfee..aa27dd4 100644
--- a/ustring.c
+++ b/ustring.c
@@ -246,6 +246,15 @@ wchar_t *ustrcpy(wchar_t *dest, wchar_t const *source) {
return ret;
}
+wchar_t *ustrncpy(wchar_t *dest, wchar_t const *source, int n) {
+ wchar_t *ret = dest;
+ do {
+ *dest++ = *source;
+ if (*source) source++;
+ } while (n-- > 0);
+ return ret;
+}
+
int ustrcmp(wchar_t *lhs, wchar_t *rhs) {
if (!lhs && !rhs) return 0;
if (!lhs) return -1;