diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2018-05-02 12:12:55 +0200 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2018-05-02 12:12:55 +0200 |
commit | 29c9bdcc141afb14fc9e1213f49de4fcded6ce0c (patch) | |
tree | cc332a0390a37bbbc01fbaf098bde75eab166de6 /src/util.cpp | |
parent | 57c57df86f14874cfc4b280e04a7f44b19839c26 (diff) |
Handle unsuccessful fseek(...):s
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/util.cpp b/src/util.cpp index 9a3067259f..b4d0a61ab2 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -887,7 +887,9 @@ void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length) { // Fallback version // TODO: just write one byte per block static const char buf[65536] = {}; - fseek(file, offset, SEEK_SET); + if (fseek(file, offset, SEEK_SET)) { + return; + } while (length > 0) { unsigned int now = 65536; if (length < now) |