scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#include <stdlib.h>
 2#include <string.h>
 3#include <wchar.h>
 4
 5#undef mbstowcs
 6
 7/*
 8 * we can reuse the internal state of mbstwocws() because
 9 * we loop in case of having a -2 from mbrtowc(), that
10 * makes impossible to leave the function in a non initial
11 * state (or error that cleans the state).
12 */
13size_t
14mbstowcs(wchar_t *restrict dest, const char *restrict src, size_t n)
15{
16	return mbsrtowcs(dest, (void *) &src, n, NULL);
17}