From c11bdd7f4712882c98b83db14032ff38cbab19b4 Mon Sep 17 00:00:00 2001 From: Imbus Date: Sat, 7 Feb 2026 13:51:44 +0100 Subject: [PATCH] Assert that the file size is above zero --- writeimg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/writeimg.c b/writeimg.c index e48c1c3..8a445ce 100644 --- a/writeimg.c +++ b/writeimg.c @@ -207,6 +207,8 @@ int main(int argc, char *argv[]) { wjob.bufsize = BLOCKSIZE; wjob.block_size = BLOCKSIZE; + assert(file_stat.st_size >= 0); + perform_write(&wjob); if (wjob.buffer)