ctype sign fixes (Tom Miller)

This commit is contained in:
rsc 2005-10-31 16:47:30 +00:00
parent 96029e052b
commit a47fbb1641
6 changed files with 7 additions and 6 deletions

View file

@ -253,7 +253,7 @@ lexc(void)
}
int
escchar(char c)
escchar(int c)
{
int n;
char buf[Strsize];

View file

@ -56,7 +56,7 @@ work(void){
int c;
struct keyw *lptr;
char *pt;
char cc;
int cc;
int ct;
while ((c = getch()) != Beof){

View file

@ -258,7 +258,7 @@ numb(float *np, int *argcp, char ***argvp){
return(0);
while((c=(*argvp)[1][0]) == '+')
(*argvp)[1]++;
if(!(isdigit(c) || c=='-'&&(*argvp)[1][1]<'A' || c=='.'))
if(!(isdigit((uchar)c) || c=='-'&&(*argvp)[1][1]<'A' || c=='.'))
return(0);
*np = atof((*argvp)[1]);
(*argcp)--;

View file

@ -23,7 +23,7 @@ gettbl(void)
break;
}
fullbot[nlin] = 0;
if (cstore[0] == '.' && !isdigit(cstore[1])) {
if (cstore[0] == '.' && !isdigit((uchar)cstore[1])) {
instead[nlin] = cstore;
while (*cstore++)
;

View file

@ -29,7 +29,7 @@ domore(char *dataln)
if (prefix(".TE", dataln))
return(0);
if (dataln[0] == '.' && !isdigit(dataln[1])) {
if (dataln[0] == '.' && !isdigit((uchar)dataln[1])) {
Bprint(&tabout, "%s\n", dataln);
return(1);
}

View file

@ -4,6 +4,7 @@ n10.c
Device interfaces
*/
#include <u.h>
#include "tdef.h"
#include "ext.h"
#include "fns.h"
@ -48,7 +49,7 @@ static char *parse(char *s, int typeit) /* convert \0, etc to nroff driving tabl
*t++ = *s++;
else {
s++; /* skip \\ */
if (isdigit(s[0]) && isdigit(s[1]) && isdigit(s[2])) {
if (isdigit((uchar)s[0]) && isdigit((uchar)s[1]) && isdigit((uchar)s[2])) {
*t++ = (s[0]-'0')<<6 | (s[1]-'0')<<3 | s[2]-'0';
s += 2;
} else if (isdigit(s[0])) {