ソースを参照

Merge pull request #248 from FrankBoesing/patch-7

fix warning: comparison of unsigned expression < 0 is always false
main
Paul Stoffregen 7年前
コミット
4962e79fee
1個のファイルの変更2行の追加2行の削除
  1. +2
    -2
      teensy3/WString.cpp

+ 2
- 2
teensy3/WString.cpp ファイルの表示

@@ -560,7 +560,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 );
@@ -576,7 +576,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++) {

読み込み中…
キャンセル
保存