aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2018-05-02 12:12:55 +0200
committerpracticalswift <practicalswift@users.noreply.github.com>2018-05-02 12:12:55 +0200
commit29c9bdcc141afb14fc9e1213f49de4fcded6ce0c (patch)
treecc332a0390a37bbbc01fbaf098bde75eab166de6 /src/util.cpp
parent57c57df86f14874cfc4b280e04a7f44b19839c26 (diff)
Handle unsuccessful fseek(...):s
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp4
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)