Avoid writing garbage to a file by checking string pointer passed to f_puts and f_printf. Important on many embedded platforms that do not abort on NULL dereference.