From 29c9bdcc141afb14fc9e1213f49de4fcded6ce0c Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 2 May 2018 12:12:55 +0200 Subject: Handle unsuccessful fseek(...):s --- src/util.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/util.cpp') diff --git a/src/util.cpp b/src/util.cpp index 9a3067259..b4d0a61ab 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) -- cgit v1.2.3