mirror of
https://github.com/eclipse/wakaama.git
synced 2025-05-08 23:31:37 +08:00
testing: Fix undefined behavior with logging
In some cases a random byte pattern was interpreted as a boolean type. This happend when the conversion to a bool was not successful but its value was logged anyway.
This commit is contained in:
parent
33ecee2fe2
commit
dd586168cf
@ -577,7 +577,7 @@ int lwm2m_data_decode_bool(const lwm2m_data_t * dataP,
|
||||
break;
|
||||
}
|
||||
|
||||
LOG_ARG("result: %d, value: %s", result, *valueP ? "true" : "false");
|
||||
LOG_ARG("result: %d, value: %s", result, result == 0 ? "undef" : (*valueP ? "true" : "false"));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user