← Commit list

f39a71817

Denys Vlasenko
Denys Vlasenko
2019-10-25
SUCCESS Duration: 155s

Subject

read_key(): placate "warning: shifting a negative signed value is undefined"

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/read_key.c+2 -1
@@ -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;
}