diff options
Diffstat (limited to 'src/svf')
-rw-r--r-- | src/svf/svf.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/svf/svf.c b/src/svf/svf.c index dec4b19..276a374 100644 --- a/src/svf/svf.c +++ b/src/svf/svf.c @@ -680,6 +680,10 @@ static int svf_copy_hexstring_to_binary(char *str, uint8_t **bin, int orig_bit_l } } + // consume optional leading '0' characters + while (str_len > 0 && str[str_len - 1] == '0') + str_len--; + // check valid if (str_len > 0 || (ch & ~((1 << (4 - (bit_len % 4))) - 1)) != 0) { |