summaryrefslogtreecommitdiff
path: root/src/stdio/fputc.c
blob: ec859385644cc9ed219c29dbb49f85cfb0cf667b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#include "stdio_impl.h"

int fputc(int c, FILE *f)
{
	FLOCK(f);
	if (c != f->lbf && f->wpos + 1 < f->wend) *f->wpos++ = c;
	else c = __overflow(f, c);
	FUNLOCK(f);
	return c;
}