[Crash-utility] [PATCH RFC 02/14] memory: do not compare unsigned expression with negative value

Oleksandr Natalenko oleksandr at redhat.com
Fri Oct 27 08:23:08 UTC 2017


Signed-off-by: Oleksandr Natalenko <oleksandr at redhat.com>
---
 memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/memory.c b/memory.c
index 9926199..abf3982 100644
--- a/memory.c
+++ b/memory.c
@@ -14467,7 +14467,7 @@ display_with_pre_and_post(void *bufptr, ulonglong addr, struct searchinfo *si)
 	}
 
 	amount = ctx * t;
-	addr_d = addr - amount < 0 ? 0 : addr - amount;
+	addr_d = (long)addr - amount < 0 ? 0 : addr - amount;
 
 	display_memory(addr_d, ctx, flag, memtype, NULL);
 
-- 
2.14.3




More information about the Crash-utility mailing list