index 0338d6c4e0ab4409d6023db96f5298d292692099..b48e19dc09fff7d7fb1d5b48673fe4448b69a7c3 100644 (file)
--- a/dir.c
+++ b/dir.c
{
struct stat st;
int fd, i;
- long size;
+ size_t size;
char *buf, *entry;
fd = open(fname, O_RDONLY);
if (fd < 0 || fstat(fd, &st) < 0)
goto err;
- size = st.st_size;
+ size = xsize_t(st.st_size);
if (size == 0) {
close(fd);
return 0;
}
buf = xmalloc(size+1);
- if (read(fd, buf, size) != size)
+ if (read_in_full(fd, buf, size) != size)
goto err;
close(fd);