From f39a71817ead331b664bc658ac26dec4ec3b75bc Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 25 Oct 2019 17:40:57 +0200 Subject: [PATCH] read_key(): placate "warning: shifting a negative signed value is undefined" Signed-off-by: Denys Vlasenko --- libbb/read_key.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libbb/read_key.c b/libbb/read_key.c index 951786869..03b7da656 100644 --- a/libbb/read_key.c +++ b/libbb/read_key.c @@ -259,7 +259,8 @@ int64_t FAST_FUNC read_key(int fd, char *buffer, int timeout) buffer[-1] = 0; /* Pack into "1 " 32-bit sequence */ - col |= (((-1 << 15) | row) << 16); + row |= ((unsigned)(-1) << 15); + col |= (row << 16); /* Return it in high-order word */ return ((int64_t) col << 32) | (uint32_t)KEYCODE_CURSOR_POS; } -- 2.25.1