improve printf impl

improve printf impl