Commit 0f143ff6 authored by rswindell's avatar rswindell

More Microsoft stupid ctype-assertion prevention, this type with isalnum().

parent 28c52f45
......@@ -1552,7 +1552,7 @@ void sbbs_t::guruchat(char* line, char* gurubuf, int gurunum, char* last_answer)
j=strlen(line);
k=0;
for(i=0;i<j;i++) {
if(line[i]<0 || !isalnum(line[i])) {
if(line[i]<0 || !isalnum((uchar)line[i])) {
if(!k) /* beginning non-alphanumeric */
continue;
if(line[i]==line[i+1]) /* redundant non-alnum */
......@@ -1565,7 +1565,7 @@ void sbbs_t::guruchat(char* line, char* gurubuf, int gurunum, char* last_answer)
cstr[k]=0;
while(k) {
k--;
if(!isalnum(cstr[k]))
if(!isalnum((uchar)cstr[k]))
continue;
break;
}
......@@ -1754,8 +1754,8 @@ void sbbs_t::guruchat(char* line, char* gurubuf, int gurunum, char* last_answer)
if(action!=NODE_MCHT) {
for(i=0;i<k;i++) {
if(i && mistakes && theanswer[i]!=theanswer[i-1] &&
((!isalnum(theanswer[i]) && !sbbs_random(100))
|| (isalnum(theanswer[i]) && !sbbs_random(30)))) {
((!isalnum((uchar)theanswer[i]) && !sbbs_random(100))
|| (isalnum((uchar)theanswer[i]) && !sbbs_random(30)))) {
c=j=((uint)sbbs_random(3)+1); /* 1 to 3 chars */
if(c<strcspn(theanswer+(i+1),"\0., "))
c=j=1;
......@@ -1917,13 +1917,13 @@ bool sbbs_t::guruexp(char **ptrptr, char *line)
else {
cp=strstr(line,str);
if(cp && c) {
if(cp!=line || isalnum(*(cp+strlen(str))))
if(cp!=line || isalnum((uchar)*(cp+strlen(str))))
cp=0;
}
else { /* must be isolated word */
while(cp)
if((cp!=line && isalnum(*(cp-1)))
|| isalnum(*(cp+strlen(str))))
if((cp!=line && isalnum((uchar)*(cp-1)))
|| isalnum((uchar)*(cp+strlen(str))))
cp=strstr(cp+strlen(str),str);
else
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment