Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

software/stdlib: fix atoi

  • Loading branch information...
commit cbd621ef2c4d5698493b45995f19eea62c2e4de1 1 parent 7c95d25
@sbourdeauducq sbourdeauducq authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 software/include/base/stdlib.h
View
7 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
Please sign in to comment.
Something went wrong with that request. Please try again.