Closed sapphonie closed 9 months ago
Boy is that an old one. Should be something like this, if you want to attempt a fix:
if (!buffer)
return;
size_t len = strlen(buffer);
while (len) {
if (!isspace((unsigned char)buffer[len - 1]))
break;
len--;
}
buffer[len] = '\0';
(or convert the code calling this to use std::string which is way nicer to work with)
Fixed as of #121
https://github.com/alliedmodders/metamod-source/blob/4401a94aa620b1db756840a7b85536846561d06f/core/metamod_util.cpp#L93-L111
Discovered while poking around CS2 mms stuff