diff options
author | Zach Eveland <zeveland@blacklabel-development.com> | 2012-01-10 12:02:27 -0500 |
---|---|---|
committer | Zach Eveland <zeveland@blacklabel-development.com> | 2012-01-10 12:02:27 -0500 |
commit | 989f672d345c71478102d9778d551c4637e88ab5 (patch) | |
tree | a194b4c486bf7e66827c6a343206be72df503047 /cores/arduino/WString.cpp | |
parent | 28e9e122af24e63e84d5bcd2c619b76c490970fc (diff) | |
parent | dd5bae59df6f1ba63083361ba284f364bc62b401 (diff) |
Merge branch 'master' of github.com:arduino/Arduino into new-extension
Diffstat (limited to 'cores/arduino/WString.cpp')
-rw-r--r-- | cores/arduino/WString.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cores/arduino/WString.cpp b/cores/arduino/WString.cpp index 3e81331..c6839fc 100644 --- a/cores/arduino/WString.cpp +++ b/cores/arduino/WString.cpp @@ -500,7 +500,7 @@ int String::lastIndexOf( char theChar ) const int String::lastIndexOf(char ch, unsigned int fromIndex) const { - if (fromIndex >= len || fromIndex < 0) return -1; + if (fromIndex >= len) return -1; char tempchar = buffer[fromIndex + 1]; buffer[fromIndex + 1] = '\0'; char* temp = strrchr( buffer, ch ); @@ -516,7 +516,7 @@ int String::lastIndexOf(const String &s2) const int String::lastIndexOf(const String &s2, unsigned int fromIndex) const { - if (s2.len == 0 || len == 0 || s2.len > len || fromIndex < 0) return -1; + if (s2.len == 0 || len == 0 || s2.len > len) return -1; if (fromIndex >= len) fromIndex = len - 1; int found = -1; for (char *p = buffer; p <= buffer + fromIndex; p++) { |