Sfoglia il codice sorgente

Update Stream.cpp

teensy4-core
Frank 5 anni fa
parent
commit
1d59fe6df4
Nessun account collegato all'indirizzo email del committer
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. +4
    -4
      teensy3/Stream.cpp

+ 4
- 4
teensy3/Stream.cpp Vedi File

@@ -89,8 +89,8 @@ bool Stream::find(const char *target, size_t length)
// as find but search ends if the terminator string is found
bool Stream::findUntil(const char *target, const char *terminator)
{
if(target == NULL) return true;
size_t tlen = (terminator==NULL)?0:strlen(terminator);
if(target == nullptr) return true;
size_t tlen = (terminator==nullptr)?0:strlen(terminator);
return findUntil(target, strlen(target), terminator, strlen(terminator));
}

@@ -102,9 +102,9 @@ bool Stream::findUntil(const char *target, size_t targetLen, const char *termina
size_t index = 0; // maximum target string length is 64k bytes!
size_t termIndex = 0;
int c;
if( target == NULL) return true;
if( target == nullptr) return true;
if( *target == 0) return true; // return true if target is a null string
if (terminator == NULL) termLen = 0;
if (terminator == nullptr) termLen = 0;

while( (c = timedRead()) > 0){
if( c == target[index]){

Loading…
Annulla
Salva