* Implemented %c in our debug() printf implementation.

This commit is contained in:
Sam Hocevar
2007-01-03 22:10:57 +00:00
committed by sam
parent de9a7ef44d
commit 6b072012f4

View File

@@ -75,7 +75,12 @@ void _zz_debug(char const *format, ...)
if(!*f)
break;
if(*f == 'i')
if(*f == 'c')
{
char i = (char)(unsigned char)va_arg(args, int);
write(fd, &i, 1);
}
else if(*f == 'i')
{
int i = va_arg(args, int);
WRITE_INT(fd, i, 10);
@@ -125,7 +130,7 @@ void _zz_debug(char const *format, ...)
}
else
{
write(fd, f, 1);
write(fd, f - 1, 2);
}
}
write(fd, "\n", 1);