-/* $OpenBSD: hack.objnam.c,v 1.9 2009/10/27 23:59:25 deraadt Exp $ */
+/* $OpenBSD: hack.objnam.c,v 1.10 2015/10/24 18:49:39 mmcc Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
cnt = 1;
cp += 2;
}
- if(!cnt && isdigit(*cp)){
+ if(!cnt && isdigit((unsigned char)*cp)){
cnt = atoi(cp);
- while(isdigit(*cp)) cp++;
+ while(isdigit((unsigned char)*cp)) cp++;
while(*cp == ' ') cp++;
}
if(!cnt) cnt = 1; /* %% what with "gems" etc. ? */
if(*cp == '+' || *cp == '-'){
spesgn = (*cp++ == '+') ? 1 : -1;
spe = atoi(cp);
- while(isdigit(*cp)) cp++;
+ while(isdigit((unsigned char)*cp)) cp++;
while(*cp == ' ') cp++;
} else {
p = strrchr(cp, '(');
else *p = 0;
p++;
spe = atoi(p);
- while(isdigit(*p)) p++;
+ while(isdigit((unsigned char)*p)) p++;
if(strcmp(p, ")")) spe = 0;
else spesgn = 1;
}
-/* $OpenBSD: hack.trap.c,v 1.7 2009/10/27 23:59:25 deraadt Exp $ */
+/* $OpenBSD: hack.trap.c,v 1.8 2015/10/24 18:49:39 mmcc Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
do {
pline("To what level do you want to teleport? [type a number] ");
getlin(buf);
- } while(!isdigit(buf[0]) && (buf[0] != '-' || !isdigit(buf[1])));
+ } while(!isdigit((unsigned char)buf[0]) &&
+ (buf[0] != '-' || !isdigit((unsigned char)buf[1])));
newlevel = atoi(buf);
} else {
newlevel = 5 + rn2(20); /* 5 - 24 */