From 8762512fdb088acefb9f3ea5f7b1e1bf2d336ff3 Mon Sep 17 00:00:00 2001 From: Rostislav Skudnov Date: Wed, 1 Feb 2017 18:35:13 +0000 Subject: Replace int -> uint to avoid signed integer overflow An example of such an error (should be compiled with DEBUG_SANITIZE): runtime error: left shift of 1 by 31 places cannot be represented in type 'int' Signed-off-by: Rostislav Skudnov Signed-off-by: Denys Vlasenko --- miscutils/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'miscutils/rx.c') diff --git a/miscutils/rx.c b/miscutils/rx.c index 36fc20a72..1f6f2825c 100644 --- a/miscutils/rx.c +++ b/miscutils/rx.c @@ -94,7 +94,7 @@ static int receive(/*int read_fd, */int file_fd) int blockBegin; int blockNo, blockNoOnesCompl; int cksum_or_crc; - int expected; + unsigned expected; int i, j; blockBegin = read_byte(timeout); -- cgit v1.2.3