diff options
author | David A. Mellis <d.mellis@arduino.cc> | 2010-12-03 23:12:41 -0500 |
---|---|---|
committer | David A. Mellis <d.mellis@arduino.cc> | 2010-12-03 23:12:41 -0500 |
commit | 053ec1b989085e0d59f84ded8641058715701a8b (patch) | |
tree | 04bc744b58ddb6fcf71a80bbbf37a5146da43f5e /cores/arduino/WString.cpp | |
parent | 4fefe032a53667cba2b801d0cc5f021b3d457ddd (diff) |
Replacing custom String.toInt() function with a call to atol().
Diffstat (limited to 'cores/arduino/WString.cpp')
-rw-r--r-- | cores/arduino/WString.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/cores/arduino/WString.cpp b/cores/arduino/WString.cpp index b13123b..4de9296 100644 --- a/cores/arduino/WString.cpp +++ b/cores/arduino/WString.cpp @@ -437,16 +437,5 @@ void String::toCharArray(char *buf, unsigned int bufsize) long String::toInt() { - String temp = _buffer; - long value = 0; - - for (unsigned int charPos = 0; charPos < _length; charPos++) { - int thisChar = temp[charPos]; - if (isdigit(thisChar)) { - value *= 10; - value += (thisChar - '0'); - } - } - - return value; + return atol(_buffer); } |