diff options
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); } |