From 0ac2d3730950c352d858565059f163699ff29a58 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Sat, 5 Oct 2013 05:04:10 +0200 Subject: [PATCH] fix UB resulting from 32/64bit type mismatch in format strings --- display.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/display.c b/display.c index 5e855db..22ee7d1 100644 --- a/display.c +++ b/display.c @@ -172,9 +172,9 @@ void display(void) if (isReadOnly) i = '%'; else if (edited) i = '*'; else i = '-'; - printw("-%c%c %s --0x%llX", i, i, baseName, base + cursor); - if (MAX(fileSize, lastEditedLoc)) printw("/0x%llX", getfilesize()); - if (mode == bySector) printw("--sector %d", (base + cursor) / SECTOR_SIZE); + printw("-%c%c %s --0x%llX", i, i, baseName, (long long) base + cursor); + if (MAX(fileSize, lastEditedLoc)) printw("/0x%llX", (long long) getfilesize()); + if (mode == bySector) printw("--sector %lld", (long long) (base + cursor) / SECTOR_SIZE); move(cursor / lineLength, computeCursorXCurrentPos()); } -- 2.11.4.GIT