Change all sprintf() calls to use snprintf()