Simplify a bit of code using snprintf().