[FL-2811] Fix PVS-Studio warnings (#2142)
Co-authored-by: あく <alleteam@gmail.com> Co-authored-by: gornekich <n.gorbadey@gmail.com>
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
#include "hex.h"
|
||||
|
||||
bool hex_char_to_hex_nibble(char c, uint8_t* nibble) {
|
||||
if((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f')) {
|
||||
if((c >= '0' && c <= '9')) {
|
||||
*nibble = c - '0';
|
||||
} else if((c >= 'A' && c <= 'F')) {
|
||||
*nibble = c - 'A' + 10;
|
||||
} else {
|
||||
*nibble = c - 'a' + 10;
|
||||
}
|
||||
if((c >= '0' && c <= '9')) {
|
||||
*nibble = c - '0';
|
||||
return true;
|
||||
} else if((c >= 'A' && c <= 'F')) {
|
||||
*nibble = c - 'A' + 10;
|
||||
return true;
|
||||
} else if(c >= 'a' && c <= 'f') {
|
||||
*nibble = c - 'a' + 10;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user