replace lib/printfmt.c to support cprintf