]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
div_test: Don't try to divide by zero
authorVladimir Serbinenko <phcoder@gmail.com>
Sat, 21 Feb 2015 15:05:45 +0000 (16:05 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sat, 21 Feb 2015 15:05:45 +0000 (16:05 +0100)
grub-core/tests/div_test.c

index 1928f8507c6d61584ce75a67d8be7bc5c9b60bc1..7bdc80b40bf9b215d63f7ad9e776d31ac6ae1bef 100644 (file)
@@ -34,6 +34,8 @@ static void
 test32 (grub_uint32_t a, grub_uint32_t b)
 {
   grub_uint64_t q, r;
+  if (b == 0)
+    return;
   q = grub_divmod64 (a, b, &r);
   grub_test_assert (r < b, "remainder is larger than dividend: 0x%llx %% 0x%llx = 0x%llx",
                    (long long) a, (long long) b, (long long) r);