diff --git a/amxmodx/format.cpp b/amxmodx/format.cpp index 0b39384a..4bc85a7a 100644 --- a/amxmodx/format.cpp +++ b/amxmodx/format.cpp @@ -390,15 +390,21 @@ reswitch: } case '%': *buf_p++ = static_cast(ch); + if (!llen) + goto done; llen--; break; case '\0': *buf_p++ = static_cast('%'); + if (!llen) + goto done; llen--; goto done; break; default: *buf_p++ = static_cast(ch); + if (!llen) + goto done; llen--; break; }