Skip to content

Commit ea90317

Browse files
Use '%u' to avoid underflow in uint8_t->int coercion
1 parent f818d06 commit ea90317

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/forder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ void radix_i(int from, int to, int radix) {
953953
uint8_t *restrict my_key = key[radix]+from; // safe to write as we don't use this radix again
954954
uint8_t *o = (uint8_t *)malloc(my_n * sizeof(uint8_t));
955955
if (!o)
956-
STOP(_("Failed to allocate %d bytes for '%s'."), (int)(my_n * sizeof(uint8_t)), "o"); // # nocov
956+
STOP(_("Failed to allocate %u bytes for '%s'."), my_n * sizeof(uint8_t), "o"); // # nocov
957957
// if last key (i.e. radix+1==nradix) there are no more keys to reorder so we could reorder osub by reference directly and save allocating and populating o just
958958
// to use it once. However, o's type is uint8_t so many moves within this max-256 vector should be faster than many moves in osub (4 byte or 8 byte ints) [1 byte
959959
// type is always aligned]

0 commit comments

Comments
 (0)