grub2/0299-div_test-Don-t-try-to-divide-by-zero.patch
Peter Jones 8c6b1ac71e Reconcile with upstream once again.
Also include some minor fixes for gcc 5.1.1

Signed-off-by: Peter Jones <pjones@redhat.com>
2015-07-22 09:46:32 -04:00

26 lines
773 B
Diff

From 2426ac36d3b42b6be507bde733c4bbd58883fe09 Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phcoder@gmail.com>
Date: Sat, 21 Feb 2015 16:05:45 +0100
Subject: [PATCH 299/506] div_test: Don't try to divide by zero
---
grub-core/tests/div_test.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/grub-core/tests/div_test.c b/grub-core/tests/div_test.c
index 1928f85..7bdc80b 100644
--- a/grub-core/tests/div_test.c
+++ b/grub-core/tests/div_test.c
@@ -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);
--
2.4.3