Hello, long time no see
I recently starting playing again with amxx, especially with the regex module:
Code:
#define RegexMatch(%1,%2) ( regex_match_c(%1,%2,ret) > 0 )
stock checkName(const pName[], dataCfg[structConfig], dataMatch[], &pid) {
if(arrConfigTotalSize<1 || arrNamesSize<1)
return false;
static lpName[64], repl[64];
copy(lpName, charsmax(lpName), pName);
strtolower(lpName);
if(containi(lpName, "replaced" )!=-1)
return false;
for (new i=0; i<arrNamesSize; i++) {
ArrayGetArray(arrConfigNames, i, dataCfg);
if(dataCfg[regexC] < REGEX_OK)
continue;
if ( RegexMatch(lpName, dataCfg[regexC]) ) {
split_string(dataCfg[replacement]," ",repl,charsmax(repl));
if(containi(lpName, repl )!=-1)
return false;
regex_substr(dataCfg[regexC], 0, dataMatch, 127);
pid = i;
return true;
}
}
return false;
}
With this piece of code server randomly hangs, i'm testing it on both win & linux with the same amxx build 1.8.3
On windows it hangs without any error, the funny thing is if i type any char in console it will 'un'hang and everything will be fine until next random hang, on linux it will hang with this error:
Code:
PM Got a NaN velocity 2
Is there any knowing issue/problem with the regex module?
I also tested without split_string & regex_substr and the problem is the same.. so i'm suspecting regex_match_c/regex_match?