1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-19 21:44:11 +01:00

Fixed two signed/unsigned comparisons.

This commit is contained in:
Wayne Davison 2004-05-28 19:20:29 +00:00
parent 7c4ac8d60b
commit fea94cd79f

@ -2524,9 +2524,8 @@ load_dump_header(char *nam, char *name, int err)
} }
memcpy(head, buf, (FD_PRELEN + 1) * sizeof(wordcode)); memcpy(head, buf, (FD_PRELEN + 1) * sizeof(wordcode));
if (read(fd, head + (FD_PRELEN + 1), len -= (FD_PRELEN + 1) * sizeof(wordcode);
len - ((FD_PRELEN + 1) * sizeof(wordcode))) != if (read(fd, head + (FD_PRELEN + 1), len) != len) {
len - ((FD_PRELEN + 1) * sizeof(wordcode))) {
close(fd); close(fd);
zwarnnam(nam, "invalid zwc file: %s" , name, 0); zwarnnam(nam, "invalid zwc file: %s" , name, 0);
return NULL; return NULL;
@ -3125,7 +3124,7 @@ check_dump_file(char *file, struct stat *sbuf, char *name, int *ksh)
} }
d = (Wordcode) zalloc(h->len + po); d = (Wordcode) zalloc(h->len + po);
if (read(fd, ((char *) d) + po, h->len) != h->len) { if (read(fd, ((char *) d) + po, h->len) != (int)h->len) {
close(fd); close(fd);
zfree(d, h->len); zfree(d, h->len);