Update error messages to define string then use them, format fprintf