library: fputc rewritten