1
0
mirror of https://github.com/openbsd/src.git synced 2026-06-18 07:13:36 +02:00

wcslcpy() and wcslcat() are in POSIX-2024. Update #include visibility

and manpages and add restrict qualifiers.

ok millert@
This commit is contained in:
guenther
2024-08-07 04:59:45 +00:00
parent 3e38cd6fb0
commit e490037411
2 changed files with 19 additions and 9 deletions
+8 -5
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: wchar.h,v 1.32 2024/07/14 10:04:17 jca Exp $ */
/* $OpenBSD: wchar.h,v 1.33 2024/08/07 04:59:45 guenther Exp $ */
/* $NetBSD: wchar.h,v 1.16 2003/03/07 07:11:35 tshiozak Exp $ */
/*-
@@ -223,12 +223,15 @@ int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict, __va_list);
int vwscanf(const wchar_t * __restrict, __va_list);
int wscanf(const wchar_t * __restrict, ...);
#if __POSIX_VISIBLE >= 202405 || __BSD_VISIBLE
size_t wcslcat(wchar_t * __restrict, const wchar_t * __restrict, size_t)
__attribute__ ((__bounded__(__wcstring__,1,3)));
size_t wcslcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t)
__attribute__ ((__bounded__(__wcstring__,1,3)));
#endif
#if __BSD_VISIBLE
wchar_t *fgetwln(FILE * __restrict, size_t * __restrict);
size_t wcslcat(wchar_t *, const wchar_t *, size_t)
__attribute__ ((__bounded__(__wcstring__,1,3)));
size_t wcslcpy(wchar_t *, const wchar_t *, size_t)
__attribute__ ((__bounded__(__wcstring__,1,3)));
#endif
#define getwc(f) fgetwc(f)
+11 -4
View File
@@ -1,4 +1,4 @@
.\" $OpenBSD: wcslcpy.3,v 1.7 2019/01/25 00:19:25 millert Exp $
.\" $OpenBSD: wcslcpy.3,v 1.8 2024/08/07 04:59:45 guenther Exp $
.\"
.\" Copyright (c) 1998, 2000 Todd C. Miller <millert@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: January 25 2019 $
.Dd $Mdocdate: August 7 2024 $
.Dt WCSLCPY 3
.Os
.Sh NAME
@@ -24,9 +24,9 @@
.Sh SYNOPSIS
.In wchar.h
.Ft size_t
.Fn wcslcpy "wchar_t *dst" "const wchar_t *src" "size_t size"
.Fn wcslcpy "wchar_t * restrict dst" "const wchar_t * restrict src" "size_t size"
.Ft size_t
.Fn wcslcat "wchar_t *dst" "const wchar_t *src" "size_t size"
.Fn wcslcat "wchar_t * restrict dst" "const wchar_t * restrict src" "size_t size"
.Sh DESCRIPTION
The
.Fn wcslcpy
@@ -137,6 +137,13 @@ The check exists to prevent potential security problems in incorrect code.
.Xr swprintf 3 ,
.Xr wcsncat 3 ,
.Xr wcsncpy 3
.Sh STANDARDS
The
.Fn wcslcpy
and
.Fn wcslcat
functions conform to
.St -p1003.1-2024 .
.Sh HISTORY
The
.Fn wcslcpy