fix format string (inspired by issue #4945)