From 5c5f9f0f1aa364e5cb44f6e236160e870377186e Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Wed, 5 Apr 2023 12:47:36 +0200 Subject: [PATCH] Use int64_t to represent the offset Using size_t causes undefined behavior when the number is negative. --- src/emu/system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emu/system.c b/src/emu/system.c index d7e85f7..dc9abc3 100644 --- a/src/emu/system.c +++ b/src/emu/system.c @@ -395,7 +395,7 @@ parse_clkoff_entry(struct loom *looms, struct clkoff_entry *entry) size_t matches = 0; /* Use the median as the offset */ - size_t offset = entry->median; + int64_t offset = (int64_t) entry->median; const char *host = entry->name; struct loom *loom;