diff options
| author | practicalswift <[email protected]> | 2018-05-02 12:12:55 +0200 |
|---|---|---|
| committer | practicalswift <[email protected]> | 2018-05-02 12:12:55 +0200 |
| commit | 29c9bdcc141afb14fc9e1213f49de4fcded6ce0c (patch) | |
| tree | cc332a0390a37bbbc01fbaf098bde75eab166de6 /src/util.cpp | |
| parent | Merge #13141: [doc] qt: fixes broken link on readme (diff) | |
| download | discoin-29c9bdcc141afb14fc9e1213f49de4fcded6ce0c.tar.xz discoin-29c9bdcc141afb14fc9e1213f49de4fcded6ce0c.zip | |
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 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) |