aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/WString.cpp
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2012-01-02 12:57:23 -0500
committerDavid A. Mellis <d.mellis@arduino.cc>2012-01-02 12:57:23 -0500
commit95b51c7728619fb9a718e15d13d99cb371905ad9 (patch)
treee68e9eb67129e457c751ae89cee1937f4d431516 /cores/arduino/WString.cpp
parent3f429a9c61ae953d24f3d19ff1f6d9b332d29b9c (diff)
Fixing warnings (unsigned comparisons to 0). (maniacbug)
Diffstat (limited to 'cores/arduino/WString.cpp')
-rw-r--r--cores/arduino/WString.cpp4
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++) {