2 * Copyright (c) 1998 Robert Nordier
4 * Copyright (c) 2006 M. Warner Losh
7 * Redistribution and use in source and binary forms are freely
8 * permitted provided that the above copyright notice and this
9 * paragraph and the following disclaimer are duplicated in all
12 * This software is provided "AS IS" and without any express or
13 * implied warranties, including, without limitation, the implied
14 * warranties of merchantability and fitness for a particular
24 printf(const char *fmt,...)
27 const char *hex = "0123456789abcdef";
34 while ((c = *fmt++)) {
39 xputchar(va_arg(ap, int));
42 for (s = va_arg(ap, char *); *s; s++)
45 case 'd': /* A lie, always prints unsigned */
47 u = va_arg(ap, unsigned);
57 u = va_arg(ap, unsigned);