10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f5ae85 commit 20844ffCopy full SHA for 20844ff
cores/arduino/WString.cpp
@@ -502,7 +502,13 @@ int String::compareTo(const String &s) const
502
if (buffer && len > 0) return *(unsigned char *)buffer;
503
return 0;
504
}
505
- return strcmp(buffer, s.buffer);
+ const char *p1 = buffer;
506
+ const char *p2 = s.buffer;
507
+
508
+ while (*p1 == *p2++)
509
+ if ('\0' == *p1++)
510
+ return 0;
511
+ return (*(const char *)p1 - *(const char *)(p2 - 1));
512
513
514
unsigned char String::equals(const String &s2) const
0 commit comments