strftime cleanup: avoid recomputing strlen when it's known