Skip to content

Commit 20b7215

Browse files
committed
fix cast
1 parent 616be5b commit 20b7215

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/random/random.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ static uint64_t user_generate(void *state) {
612612
if (size > 0) {
613613
/* Endianness safe copy */
614614
for (i = 0; i < size; i++) {
615-
result += (unsigned char) Z_STRVAL(retval)[i] << 8 * i;
615+
result += ((uint64_t) (unsigned char) Z_STRVAL(retval)[i]) << (8 * i);
616616
}
617617
} else {
618618
result = 0;

0 commit comments

Comments
 (0)