mirror of
https://github.com/siemens-mobile-hacks/dc166-patch.git
synced 2026-11-25 19:37:24 +00:00
17 lines
408 B
C
17 lines
408 B
C
#include "dc166_stdio.h"
|
|
|
|
int fputc(int character, FILE *stream)
|
|
{
|
|
unsigned char byte = (unsigned char)character;
|
|
|
|
if ((stream->_flag & (_IOWR | _IOSTRG)) == (_IOWR | _IOSTRG)) {
|
|
if (--stream->_cnt < 0)
|
|
return EOF;
|
|
*stream->_ptr++ = (char)byte;
|
|
return (int)byte;
|
|
}
|
|
if (--stream->_cnt < 0)
|
|
return _flsbuf((int)byte, stream);
|
|
*stream->_ptr++ = (char)byte;
|
|
return (int)byte;
|
|
}
|