Reset data and simplify the snprintf call.