diff --git a/second/printf.c b/second/printf.c index 10fd747..224ad82 100644 --- a/second/printf.c +++ b/second/printf.c @@ -63,6 +63,20 @@ typedef unsigned char u_char; static char *ksprintn(u_long ul, int base, int *lenp, int prec); +int puts(const char * s) +{ + console_print(s); + + return -1; +} + +int putchar(int c) +{ + console_put(c); + + return c; +} + int sprintf(char * s, const char * format, ...) { va_list params; @@ -219,17 +233,8 @@ ksprintn(u_long ul, int base, int *lenp, int prec) for(i=0;i> 16]; -#else *++p = "0123456789abcdef"[ul % base]; ul /= base; -#endif } while ((--prec > 0 || ul != 0) && p < buf + sizeof(buf) - 1); if (lenp) *lenp = p - buf; @@ -250,7 +255,7 @@ printf(const char * format, ...) va_end(args); if (len) - console_print(__printf_buffer); + puts(__printf_buffer); return len; }