From f649a6a8fd08a6bae525c88a5db909ece9bb466f Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 13 Nov 2013 00:51:06 +0100 Subject: [PATCH] * grub-core/term/tparm.c (tparam_internal): Use unsigned divisions. --- ChangeLog | 4 ++++ grub-core/term/tparm.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6ad820046..6f283eb01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-11-12 Vladimir Serbinenko + + * grub-core/term/tparm.c (tparam_internal): Use unsigned divisions. + 2013-11-12 Vladimir Serbinenko Add missing includes of loader.h. diff --git a/grub-core/term/tparm.c b/grub-core/term/tparm.c index 8c1c288a0..fce7dd479 100644 --- a/grub-core/term/tparm.c +++ b/grub-core/term/tparm.c @@ -614,13 +614,15 @@ tparam_internal(const char *string, va_list ap) case '/': y = npop(); x = npop(); - npush(y ? (x / y) : 0); + /* GRUB has no signed divisions. */ + npush(y ? ((unsigned)x / (unsigned)y) : 0); break; case 'm': y = npop(); x = npop(); - npush(y ? (x % y) : 0); + /* GRUB has no signed divisions. */ + npush(y ? ((unsigned)x % (unsigned)y) : 0); break; case 'A':