diff --git a/XUtils.c b/XUtils.c index aa9cc9e4a..94a14df64 100644 --- a/XUtils.c +++ b/XUtils.c @@ -238,6 +238,8 @@ int xAsprintf(char** strp, const char* fmt, ...) { } int xSnprintf(char* buf, size_t len, const char* fmt, ...) { + assert(len > 0); + va_list vl; va_start(vl, fmt); int n = vsnprintf(buf, len, fmt, vl);