Replace int_to_str() hack with snprintf().