summaryrefslogtreecommitdiff
path: root/lib/strto.c
AgeCommit message (Collapse)AuthorFilesLines
2017-09-15lib: strto: fix incorrect handling of specified baseRob Clark1-26/+19
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>
2016-10-11Fix return value in trailing_strtoln()Simon Glass1-3/+5
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>
2015-12-14lib: split out strtoxxxx functions out of vsprintf.cSjoerd Simons1-0/+174
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>