diff options
-rw-r--r-- | libbb/read_key.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) | |||
259 | 259 | ||
260 | buffer[-1] = 0; | 260 | buffer[-1] = 0; |
261 | /* Pack into "1 <row15bits> <col16bits>" 32-bit sequence */ | 261 | /* Pack into "1 <row15bits> <col16bits>" 32-bit sequence */ |
262 | col |= (((-1 << 15) | row) << 16); | 262 | row |= ((unsigned)(-1) << 15); |
263 | col |= (row << 16); | ||
263 | /* Return it in high-order word */ | 264 | /* Return it in high-order word */ |
264 | return ((int64_t) col << 32) | (uint32_t)KEYCODE_CURSOR_POS; | 265 | return ((int64_t) col << 32) | (uint32_t)KEYCODE_CURSOR_POS; |
265 | } | 266 | } |