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 mbtowc
 6
 7int
 8mbtowc(wchar_t *restrict pwc, const char *restrict s, size_t n)
 9{
10	int ret;
11	static mbstate_t st;
12
13	ret = mbrtowc(pwc, s, n, &st);
14	if (ret == -2) {
15		memset(&st, 0, sizeof(st));
16		ret = -1;
17	}
18
19	return ret;
20}