File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
hardware/arduino/cores/arduino Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -500,7 +500,7 @@ int String::lastIndexOf( char theChar ) const
500
500
501
501
int String::lastIndexOf (char ch, unsigned int fromIndex) const
502
502
{
503
- if (fromIndex >= len || fromIndex < 0 ) return -1 ;
503
+ if (fromIndex >= len) return -1 ;
504
504
char tempchar = buffer[fromIndex + 1 ];
505
505
buffer[fromIndex + 1 ] = ' \0 ' ;
506
506
char * temp = strrchr ( buffer, ch );
@@ -516,7 +516,7 @@ int String::lastIndexOf(const String &s2) const
516
516
517
517
int String::lastIndexOf (const String &s2, unsigned int fromIndex) const
518
518
{
519
- if (s2.len == 0 || len == 0 || s2.len > len || fromIndex < 0 ) return -1 ;
519
+ if (s2.len == 0 || len == 0 || s2.len > len) return -1 ;
520
520
if (fromIndex >= len) fromIndex = len - 1 ;
521
521
int found = -1 ;
522
522
for (char *p = buffer; p <= buffer + fromIndex; p++) {
You can’t perform that action at this time.
0 commit comments