scc

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

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

 1#include <stdio.h>
 2
 3#undef fwrite
 4
 5size_t
 6fwrite(const void * restrict ptr, size_t size, size_t nmemb,
 7       FILE * restrict fp)
 8{
 9	const unsigned char *bp = ptr;
10	size_t n, i;
11
12	if (size == 0)
13		return 0;
14
15	for (n = 0; n < nmemb; n++) {
16		i = size;
17		do
18			putc(*bp++, fp);
19		while (--i);
20		if (ferror(fp))
21			break;
22	}
23
24	return n;
25}