The strto functions should honor the specified base (if non-zero) rather
than permitting a hex or octal string when the user wanted (for example)
base 10.
This has been fixed somewhere along the way in the upstream linux kernel
src tree, at some point after these was copied in to u-boot. And also
in a way that duplicates less code. So port _parse_integer_fixup_radix()
to u-boot.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This function should return -1 if there is no trailing integer in the
string. Instead it returns 0. Fix it by checking for this condition at the
start.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
To allow the various string to number conversion functions to be used
when using tiny-printf,split them out into their own file which gets
build regardless of what printf implementation is used.
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>