From 23a5258e376c82617b807369a5dea6bf897e6724 Mon Sep 17 00:00:00 2001 From: Dale Whinham Date: Fri, 11 Dec 2020 19:29:41 +0000 Subject: [PATCH] minimig: Fix ACTION_SEEK when offset is negative Some applications would fail to load some files due to negative seek offsets being corrupted by unsigned conversion. A simple test case is AmigaGuide: place an AmigaGuide document on the shared volume and attempt to open it. Before this patch, this would fail silently. --- support/minimig/minimig_share.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/support/minimig/minimig_share.cpp b/support/minimig/minimig_share.cpp index f065360..213e392 100644 --- a/support/minimig/minimig_share.cpp +++ b/support/minimig/minimig_share.cpp @@ -591,10 +591,10 @@ static int process_request(void *reqres_buffer) break; } - uint32_t old_pos = open_file_handles[key].offset; + int old_pos = open_file_handles[key].offset; - uint32_t new_pos = SWAP_INT(req->new_pos); - uint32_t mode = SWAP_INT(req->mode); + int new_pos = SWAP_INT(req->new_pos); + int mode = SWAP_INT(req->mode); int origin = SEEK_SET; if (mode == OFFSET_CURRENT) origin = SEEK_CUR;