If you had snprintf you could replace the formatted output with a truncated output or a warning message instead of crashing.