shithub: femtolisp

Download patch

ref: a0b13ce06f42c7f7f37f350f3b5811c0cb3aaf74
parent: 5b498d17047e767e07ff85b662ce03218cf624ed
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Thu Jan 2 01:14:44 EST 2025

qp tries: knybble: force shift to be on an unsigned char

--- a/3rd/fn.h
+++ b/3rd/fn.h
@@ -158,7 +158,7 @@
 static inline uint8_t
 knybble(const char *key, uint32_t off, uint32_t shift)
 {
-	uint32_t word = key[off]<<8;
+	uint32_t word = (uint8_t)key[off]<<8;
 	if(word)
 		word |= key[off+1];
 	uint32_t right = 16 - 5 - shift;