summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorkamil <kamil@NetBSD.org>2016-10-15 14:21:59 +0000
committerkamil <kamil@NetBSD.org>2016-10-15 14:21:59 +0000
commitb0335e40b643ede157fc1fff83202930629a9eae (patch)
tree6c91cb76973fc47306a46ae3b463c575abb4bd0d /include
parent4cbd0e390853f72ad7d8237b9105eea45dd62ccd (diff)
Import wcsnlen(3) to libc
The wcsnlen(3) function conforms to POSIX.1-2008 and is an addition to the ISO C standard. size_t wcsnlen(const wchar_t *s, size_t maxlen); The wcsnlen(3) function computes the number of wide-characters in a wide- -string to which s points, not including NULL terminating wide-character code and checking no more than maxlen wide-characters. This function never examines wide-characters beyond a wide-string of maxlen size. This function is a safer version of wcslen(3): size_t wcslen(const wchar_t *s); Update STANDARDS section of wmemchr(3) describing wide-character functions.
Diffstat (limited to 'include')
-rw-r--r--include/wchar.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/wchar.h b/include/wchar.h
index 858709ff1e2..0cad6e94735 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: wchar.h,v 1.41 2014/10/13 00:47:03 christos Exp $ */
+/* $NetBSD: wchar.h,v 1.42 2016/10/15 14:22:00 kamil Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@@ -116,6 +116,7 @@ size_t wcslen(const wchar_t *);
wchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict, size_t);
int wcsncmp(const wchar_t *, const wchar_t *, size_t);
wchar_t *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t);
+size_t wcsnlen(const wchar_t *, size_t);
wchar_t *wcspbrk(const wchar_t *, const wchar_t *);
wchar_t *wcsrchr(const wchar_t *, wchar_t);
size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t,