From: Sebastien Bourdeauducq Date: Fri, 31 May 2013 12:44:52 +0000 (+0200) Subject: software/stdlib: fix atoi X-Git-Tag: 24jan2021_ls180~2909 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cbd621ef2c4d5698493b45995f19eea62c2e4de1;p=litex.git software/stdlib: fix atoi --- diff --git a/software/include/base/stdlib.h b/software/include/base/stdlib.h index 64ddabfd..790e4eb0 100644 --- a/software/include/base/stdlib.h +++ b/software/include/base/stdlib.h @@ -47,16 +47,17 @@ static inline long int labs(long int x) } unsigned long strtoul(const char *nptr, char **endptr, int base); +long strtol(const char *nptr, char **endptr, int base); +double strtod(const char *str, char **endptr); + int skip_atoi(const char **s); static inline int atoi(const char *nptr) { - return strtoul(nptr, NULL, 0); + return strtol(nptr, NULL, 10); } static inline long atol(const char *nptr) { return (long)atoi(nptr); } char *number(char *buf, char *end, unsigned long num, int base, int size, int precision, int type); -long strtol(const char *nptr, char **endptr, int base); -double strtod(const char *str, char **endptr); #define RAND_MAX 2147483647