replace non formatting printf to (f)puts