coap_encode.c: Fix coap_flsll() for negative numbers

This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2023-04-04 19:35:09 +01:00
1 parent 00e4510636
commit 53615f5643
1 file changed
+2 -1
+2 -1
View File
@@ -23,8 +23,9 @@ int coap_fls(unsigned int i) {
#endif
#ifndef HAVE_FLSLL
int coap_flsll(long long i)
int coap_flsll(long long j)
{
unsigned long long i = (unsigned long long)j;
int n;
for (n = 0; i; n++)
i >>= 1;