瀏覽代碼

fix

teensy4-core
Frank 6 年之前
父節點
當前提交
0c2c9e3d75
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. +3
    -3
      teensy4/Stream.cpp

+ 3
- 3
teensy4/Stream.cpp 查看文件

@@ -90,8 +90,8 @@ bool Stream::find(const char *target, size_t length)
bool Stream::findUntil(const char *target, const char *terminator)
{
if(target == NULL) return true;
if(terminator == NULL) return true;
return findUntil(target, strlen(target), terminator, strlen(terminator));
size_t tlen = (terminator==NULL)?0:strlen(terminator);
return findUntil(target, strlen(target), terminator, tlen);
}

// reads data from the stream until the target string of the given length is found
@@ -105,7 +105,7 @@ bool Stream::findUntil(const char *target, size_t targetLen, const char *termina

if( target == NULL) return true;
if( *target == 0) return true; // return true if target is a null string
if(terminator == NULL) return true;
if (terminator == NULL) termLen = 0;
while( (c = timedRead()) > 0){
if( c == target[index]){

Loading…
取消
儲存