From 2792c332b848c5cc57621c6490d5aee9f54e5054 Mon Sep 17 00:00:00 2001 From: Mikko Marttila <13412395+mikmart@users.noreply.github.com> Date: Mon, 25 Aug 2025 13:57:16 +0100 Subject: [PATCH] Ensure column matches %ld format in jimp_diagf .. on Windows %ld expects 32 bits but ptrdiff_t is 64 bits. --- jimp.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jimp.h b/jimp.h index 995a05c..0764f9a 100644 --- a/jimp.h +++ b/jimp.h @@ -273,8 +273,9 @@ void jimp_diagf(Jimp *jimp, const char *fmt, ...) line_number += 1; } } + long line_offset = point - line_start; - fprintf(stderr, "%s:%ld:%ld: ", jimp->file_path, line_number + 1, point - line_start + 1); + fprintf(stderr, "%s:%ld:%ld: ", jimp->file_path, line_number + 1, line_offset + 1); va_list args; va_start(args, fmt); vfprintf(stderr, fmt, args);