]> git.baikalelectronics.ru Git - uboot.git/commit
lib: Improve _parse_integer_fixup_radix base 16 detection
authorMichal Simek <michal.simek@xilinx.com>
Fri, 7 Feb 2020 12:04:10 +0000 (13:04 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 6 Apr 2020 10:52:45 +0000 (12:52 +0200)
commit161bc46ea378e96f5c4bcb7a76fff61aedc5296a
tree09a7a0abdb8b1075f107e89419d39b1d1d9fa2b7
parentc190f459fccd01ccfd71985a5f010b1767d67a5f
lib: Improve _parse_integer_fixup_radix base 16 detection

Base autodetection is failing for this case:
if test 257 -gt 3ae; then echo first; else echo second; fi

It is because base for 3ae is recognized by _parse_integer_fixup_radix() as
10. The code detects the first char which is not between 'a'/'A' or 'f'/'F'
to change base from dec to hex.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Shiril Tichkule <shirilt@xlinx.com>
lib/strto.c