Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

software/stdlib: fix atoi

  • Loading branch information...
commit cbd621ef2c4d5698493b45995f19eea62c2e4de1 1 parent 7c95d25
Sébastien Bourdeauducq authored May 31, 2013

Showing 1 changed file with 4 additions and 3 deletions. Show diff stats Hide diff stats

  1. 7  software/include/base/stdlib.h
7  software/include/base/stdlib.h
@@ -47,16 +47,17 @@ static inline long int labs(long int x)
47 47
 }
48 48
 
49 49
 unsigned long strtoul(const char *nptr, char **endptr, int base);
  50
+long strtol(const char *nptr, char **endptr, int base);
  51
+double strtod(const char *str, char **endptr);
  52
+
50 53
 int skip_atoi(const char **s);
51 54
 static inline int atoi(const char *nptr) {
52  
-	return strtoul(nptr, NULL, 0);
  55
+	return strtol(nptr, NULL, 10);
53 56
 }
54 57
 static inline long atol(const char *nptr) {
55 58
 	return (long)atoi(nptr);
56 59
 }
57 60
 char *number(char *buf, char *end, unsigned long num, int base, int size, int precision, int type);
58  
-long strtol(const char *nptr, char **endptr, int base);
59  
-double strtod(const char *str, char **endptr);
60 61
 
61 62
 #define   RAND_MAX        2147483647
62 63
 

0 notes on commit cbd621e

Please sign in to comment.
Something went wrong with that request. Please try again.