From 6b072012f4666e278b54a6f27086e16d652cb5f2 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Wed, 3 Jan 2007 22:10:57 +0000 Subject: [PATCH] * Implemented %c in our debug() printf implementation. --- src/debug.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/debug.c b/src/debug.c index 13ecbe3..21a3598 100644 --- a/src/debug.c +++ b/src/debug.c @@ -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);