]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/term/tparm.c (tparam_internal): Use unsigned divisions.
authorVladimir Serbinenko <phcoder@gmail.com>
Tue, 12 Nov 2013 23:51:06 +0000 (00:51 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Tue, 12 Nov 2013 23:51:06 +0000 (00:51 +0100)
ChangeLog
grub-core/term/tparm.c

index 6ad820046d127b763e15845909a735781eab99aa..6f283eb019e6e1eb1ce7b08070d62a2b8a37c0f1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-12  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/term/tparm.c (tparam_internal): Use unsigned divisions.
+
 2013-11-12  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Add missing includes of loader.h.
index 8c1c288a0bb1c579fe61ecedf2abd43c39a4f321..fce7dd47984ced4cafc854ede4d74ae00329260d 100644 (file)
@@ -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':