more signedness bugs

This commit is contained in:
rsc 2005-11-01 18:06:00 +00:00
parent 14367520a2
commit 5ed63a9b4e
3 changed files with 4 additions and 5 deletions

View file

@ -1,4 +1,3 @@
#include <u.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View file

@ -189,9 +189,9 @@ input(void)
ERROR "argfp underflow" FATAL; ERROR "argfp underflow" FATAL;
popsrc(); popsrc();
goto loop; goto loop;
} else if (c == '$' && isdigit((uchar)*srcp->sp)) { } else if (c == '$' && isdigit((unsigned char)*srcp->sp)) {
int n = 0; int n = 0;
while (isdigit((uchar)*srcp->sp)) while (isdigit((unsigned char)*srcp->sp))
n = 10 * n + *srcp->sp++ - '0'; n = 10 * n + *srcp->sp++ - '0';
if (n > 0 && n <= MAXARGS) if (n > 0 && n <= MAXARGS)
pushsrc(String, argfp->argstk[n-1]); pushsrc(String, argfp->argstk[n-1]);

View file

@ -13,7 +13,7 @@ void setsize(char *p) /* set size as found in p */
ps -= atoi(p+1); ps -= atoi(p+1);
if (szstack[nszstack-1] != 0) if (szstack[nszstack-1] != 0)
szstack[nszstack] = ps; szstack[nszstack] = ps;
} else if (isdigit((uchar)*p)) { } else if (isdigit((unsigned char)*p)) {
if (szstack[nszstack-1] == 0) if (szstack[nszstack-1] == 0)
printf(".nr %d \\n(.s\n", 99-nszstack); printf(".nr %d \\n(.s\n", 99-nszstack);
else else
@ -52,7 +52,7 @@ void globsize(void)
gsize -= atoi(temp+1); gsize -= atoi(temp+1);
if (szstack[0] != 0) if (szstack[0] != 0)
szstack[0] = gsize; szstack[0] = gsize;
} else if (isdigit((uchar)temp[0])) { } else if (isdigit((unsigned char)temp[0])) {
gsize = atoi(temp); gsize = atoi(temp);
szstack[0] = gsize; szstack[0] = gsize;
printf(".nr 99 \\n(.s\n"); printf(".nr 99 \\n(.s\n");