support '%c' specifier in xfprintf

This commit is contained in:
Yuichi Nishiwaki 2015-07-20 19:02:52 +09:00
parent 569b14d684
commit 6b42145e00
1 changed files with 5 additions and 1 deletions

View File

@ -349,7 +349,7 @@ int xvfprintf(pic_state *pic, xFILE *stream, const char *fmt, va_list ap) {
case 'f': { case 'f': {
char buf[100]; char buf[100];
sprintf(buf, "%g", va_arg(ap, double)); sprintf(buf, "%g", va_arg(ap, double));
xfputs(pic, buf, stream); cnt += xfputs(pic, buf, stream);
break; break;
} }
#else #else
@ -378,6 +378,10 @@ int xvfprintf(pic_state *pic, xFILE *stream, const char *fmt, va_list ap) {
break; break;
} }
#endif #endif
case 'c':
ival = va_arg(ap, int);
cnt += xfputc(pic, ival, stream);
break;
case 's': case 's':
sval = va_arg(ap, char*); sval = va_arg(ap, char*);
cnt += xfputs(pic, sval, stream); cnt += xfputs(pic, sval, stream);