Namazu-devel-ja(旧)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Dumps core at reading 0 byte file (namazu-bugs-ja#18)
- From: kuriyama@xxxxxxxxxxx
- Date: Wed, 10 May 2000 14:00:39 +0900 (JST)
- X-ml-name: namazu-devel-ja
- X-mail-count: 00473
Full_Name: Jun Kuriyama
Version: 2.0.4
OS: FreeBSD
Submission from: (NULL) (210.226.20.160)
nmz_readfile() returns NULL when reading file succussfully which file size is
0.
I think this patch should be applied:
--- nmz/util.c~ Tue Mar 14 00:32:03 2000
+++ nmz/util.c Wed May 10 12:51:56 2000
@@ -433,7 +433,8 @@
nmz_set_dyingmsg(nmz_msg("%s: %s", fname, strerror(errno)));
return NULL;
}
- if (fread(buf, sizeof(char), fstatus.st_size, fp) == 0) {
+ if (fstatus.st_size != 0 &&
+ fread(buf, sizeof(char), fstatus.st_size, fp) == 0) {
nmz_set_dyingmsg(nmz_msg("%s: %s", fname, strerror(errno)));
return NULL;
}