mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
misc: array bounds fixes that gcc finds (John Gosset)
This commit is contained in:
parent
77809fb0cc
commit
ada24b4005
6 changed files with 6 additions and 9 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
char *version = "version Oct 24, 1991";
|
||||
|
||||
char in[MAXLINE]; /* input buffer */
|
||||
char in[MAXLINE+1]; /* input buffer */
|
||||
int noeqn;
|
||||
char *cmdname;
|
||||
|
||||
|
|
|
@ -351,11 +351,8 @@ skipextension(Header *h)
|
|||
}
|
||||
if(hsize>0 && Bread(h->fd, h->buf, hsize) != hsize)
|
||||
giferror(h, extreaderr);
|
||||
if(!hasdata){
|
||||
if(h->buf[hsize-1] != 0)
|
||||
giferror(h, "ReadGIF: bad extension format");
|
||||
if(!hasdata)
|
||||
return;
|
||||
}
|
||||
|
||||
/* loop counter: Application Extension with NETSCAPE2.0 as string and 1 <loop.count> in data */
|
||||
if(type == 0xFF && hsize==11 && memcmp(h->buf, "NETSCAPE2.0", 11)==0){
|
||||
|
|
|
@ -93,7 +93,7 @@ popdir(Ram *r)
|
|||
continue;
|
||||
f = iget(ino);
|
||||
strncpy(name, dp->name, VNAMELEN);
|
||||
name[VNAMELEN+1] = '\0';
|
||||
name[VNAMELEN] = '\0';
|
||||
f.name = name;
|
||||
popfile(r, f);
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ popdir(Ram *r)
|
|||
continue;
|
||||
f = iget(ino);
|
||||
strncpy(name, dp->name, VNAMELEN);
|
||||
name[VNAMELEN+1] = '\0';
|
||||
name[VNAMELEN] = '\0';
|
||||
f.name = name;
|
||||
popfile(r, f);
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ popdir(Ram *r)
|
|||
continue;
|
||||
f = iget(ino);
|
||||
strncpy(name, dp->name, V6NAMELEN);
|
||||
name[V6NAMELEN+1] = '\0';
|
||||
name[V6NAMELEN] = '\0';
|
||||
f.name = name;
|
||||
popfile(r, f);
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ void t_ptinit(void)
|
|||
ics = EM; /* insertion character space */
|
||||
for (i = 0; i < (NTAB - 1) && DTAB * (i + 1) < TABMASK; i++)
|
||||
tabtab[i] = DTAB * (i + 1);
|
||||
tabtab[NTAB] = 0;
|
||||
tabtab[NTAB-1] = 0;
|
||||
pl = 11 * INCH; /* paper length */
|
||||
po = PO; /* page offset */
|
||||
spacesz = SS;
|
||||
|
|
Loading…
Reference in a new issue