summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/fputws.c
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2009-01-15 18:53:52 +0000
committerrdivacky <rdivacky@FreeBSD.org>2009-01-15 18:53:52 +0000
commit68edecb54458a58111725209d5eefba8f2ea01aa (patch)
treefca663953f11d103ba29a50566b47a332378986c /lib/libc/stdio/fputws.c
parent2d3842287a220a3cdfb3ebdc2a413e5ed57798dd (diff)
downloadFreeBSD-src-68edecb54458a58111725209d5eefba8f2ea01aa.zip
FreeBSD-src-68edecb54458a58111725209d5eefba8f2ea01aa.tar.gz
Introduce a local variable and use it instead of passed in parameter
to get rid of restrict qualifier discarding. This lets libc compile cleanly in gnu99 mode. Suggested by: kib, christoph.mallon at gmx.de Approved by: kib (mentor)
Diffstat (limited to 'lib/libc/stdio/fputws.c')
-rw-r--r--lib/libc/stdio/fputws.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/stdio/fputws.c b/lib/libc/stdio/fputws.c
index 7397411..b4462b7 100644
--- a/lib/libc/stdio/fputws.c
+++ b/lib/libc/stdio/fputws.c
@@ -45,6 +45,7 @@ fputws(const wchar_t * __restrict ws, FILE * __restrict fp)
char buf[BUFSIZ];
struct __suio uio;
struct __siov iov;
+ const wchar_t *wsp;
FLOCKFILE(fp);
ORIENT(fp, 1);
@@ -54,7 +55,8 @@ fputws(const wchar_t * __restrict ws, FILE * __restrict fp)
uio.uio_iovcnt = 1;
iov.iov_base = buf;
do {
- nbytes = __wcsnrtombs(buf, &ws, SIZE_T_MAX, sizeof(buf),
+ wsp = ws;
+ nbytes = __wcsnrtombs(buf, &wsp, SIZE_T_MAX, sizeof(buf),
&fp->_mbstate);
if (nbytes == (size_t)-1)
goto error;
OpenPOWER on IntegriCloud