use snprintf in error message