diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-07-20T21·11+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-07-20T21·11+0000 |
commit | 7984cfc7c18c85c5db42c5c7d57927b12c846ce0 (patch) | |
tree | a728a7500892e4de089c090538cb8fd34e4a1ffa /src/references.cc | |
parent | 667a6afb9dabcb3e5c851b910705b7eb1c87c9b6 (diff) |
* Argh, another short-write problem. Added wrappers around
read()/write() to fix this once and for all.
Diffstat (limited to 'src/references.cc')
-rw-r--r-- | src/references.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/references.cc b/src/references.cc index a42c1aed02c1..8934d53061cd 100644 --- a/src/references.cc +++ b/src/references.cc @@ -55,12 +55,11 @@ void checkPath(const string & path, int fd = open(path.c_str(), O_RDONLY); if (fd == -1) throw SysError(format("opening file `%1%'") % path); - char * buf = new char[st.st_size]; + unsigned char * buf = new unsigned char[st.st_size]; - if (read(fd, buf, st.st_size) != st.st_size) - throw SysError(format("reading file %1%") % path); + readFull(fd, buf, st.st_size); - search(string(buf, st.st_size), ids, seen); + search(string((char *) buf, st.st_size), ids, seen); delete buf; /* !!! autodelete */ |