summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/read_key.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libbb/read_key.c b/libbb/read_key.c
index 9517868..03b7da6 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 <row15bits> <col16bits>" 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;
}