mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-13 13:37:52 +00:00
Add check for return value of hex2val
This commit is contained in:
@@ -69,7 +69,7 @@ hex2bin(const char *hex, uint8_t *bin, size_t bin_len)
|
||||
|
||||
while (*hex && len < bin_len) {
|
||||
rc = hex2val(*hex++, &tmp_val);
|
||||
if (rc < 0) {
|
||||
if (rc != 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ hex2bin(const char *hex, uint8_t *bin, size_t bin_len)
|
||||
}
|
||||
|
||||
rc = hex2val(*hex++, &tmp_val);
|
||||
if (rc < 0) {
|
||||
if (rc != 0) {
|
||||
return 0;
|
||||
}
|
||||
bin[len++] |= tmp_val;
|
||||
|
||||
Reference in New Issue
Block a user