Fix 32 bits negative values YAML saving

This commit is contained in:
David PHAM-VAN
2022-09-06 19:53:12 +10:00
committed by Peter Feerick
parent c1e8a54e59
commit c103abb58b
+1 -1
View File
@@ -244,7 +244,7 @@ char* yaml_rgb2hex(uint32_t i)
int32_t yaml_to_signed(uint32_t i, uint32_t bits)
{
if (i & (1 << (bits-1))) {
if (bits < 32 && (i & (1 << (bits-1)))) {
i |= 0xFFFFFFFF << bits;
}