diff options
author | Simon Bünzli <zeniko@gmail.com> | 2013-09-13 20:52:15 +0200 |
---|---|---|
committer | Simon Bünzli <zeniko@gmail.com> | 2013-09-27 16:24:26 +0200 |
commit | e6ad4dbd07ecffdb764a58977a013c862263355b (patch) | |
tree | 9e9a5489a9166995e0f988897c4034d953ae6058 /source/pdf/pdf-xref.c | |
parent | 2c615e5aa18c7a34118605774de70b6b65f04b19 (diff) | |
download | mupdf-e6ad4dbd07ecffdb764a58977a013c862263355b.tar.xz |
stop checking if the result of fz_read is negative
fz_read used to return a negative value on errors. With the
introduction of fz_try/fz_catch, it throws an error instead and
always returns non-negative values. This removes the pointless
checks.
Diffstat (limited to 'source/pdf/pdf-xref.c')
-rw-r--r-- | source/pdf/pdf-xref.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index 6d440418..fbadd0a4 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -309,8 +309,6 @@ pdf_read_start_xref(pdf_document *doc) fz_seek(doc->file, t, SEEK_SET); n = fz_read(doc->file, buf, sizeof buf); - if (n < 0) - fz_throw(doc->ctx, FZ_ERROR_GENERIC, "cannot read from file"); for (i = n - 9; i >= 0; i--) { @@ -467,8 +465,8 @@ pdf_read_old_xref(pdf_document *doc, pdf_lexbuf *buf) { pdf_xref_entry *entry = pdf_get_populating_xref_entry(doc, i); n = fz_read(doc->file, (unsigned char *) buf->scratch, 20); - if (n < 0) - fz_throw(doc->ctx, FZ_ERROR_GENERIC, "cannot read xref table"); + if (n != 20) + fz_throw(doc->ctx, FZ_ERROR_GENERIC, "unexpected EOF in xref table"); if (!entry->type) { s = buf->scratch; |