summaryrefslogtreecommitdiff
path: root/src/wchar/fputws.c
blob: ad48fbfe2ae46c8f5e1d0d6839a134d0a74512c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <wchar.h>
#include <stdio.h>
#include "_safety.h"

int fputws(const wchar_t * restrict s, FILE * restrict stream)
{
	SIGNAL_SAFE(0);
	/* TODO: overlap */

	const wchar_t *p = s;
	while (*p != L'\0') {
		if (fputwc(*p, stream) == EOF) {
			return EOF;
		}
		p++;
	}
	return 0;
}

/*
STDC(199409)
*/