str_format_time: do not hard-code buffer length - fix #2242