Skip to content

Commit 8563d18

Browse files
br3akzeroclaude
andcommitted
fix: check ftruncate return value to silence -Werror
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3eafdc1 commit 8563d18

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

dl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ dl_package(const char* manifest_url, const char* path, dl_progress_t* cb,
367367

368368
if (existing > 0) {
369369
fseeko(state.file, -existing, SEEK_END);
370-
ftruncate(fileno(state.file), ftello(state.file));
370+
if (ftruncate(fileno(state.file), ftello(state.file)) != 0)
371+
perror("ftruncate");
371372
state.remaining += existing;
372373
existing = 0;
373374
}

0 commit comments

Comments
 (0)