mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Handle unsuccessful fseek(...):s
This commit is contained in:
parent
57c57df86f
commit
29c9bdcc14
3 changed files with 10 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue