nuttx/libs/libc/time: fix runtime error by UBSan

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
This commit is contained in:
Junbo Zheng 2022-09-05 10:15:09 +08:00 committed by Xiang Xiao
parent 23b27419e2
commit 74ab851ac4

View File

@ -461,7 +461,7 @@ static int_fast64_t detzcode64(FAR const char *codep)
result = (codep[0] & 0x80) ? -1 : 0; result = (codep[0] & 0x80) ? -1 : 0;
for (i = 0; i < 8; ++i) for (i = 0; i < 8; ++i)
{ {
result = (result << 8) | (codep[i] & 0xff); result = (result * 256) | (codep[i] & 0xff);
} }
return result; return result;