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