소스 검색

Fix PR comments

Update CR and LF symbols skipping at the end of the line
Vladimir Petrigo 3 년 전
부모
커밋
f75678a426
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      minmea.c

+ 6 - 1
minmea.c

@@ -79,8 +79,13 @@ bool minmea_check(const char *sentence, bool strict)
     }
 
     // The only stuff allowed at this point is a newline.
-    if (*sentence && strcmp(sentence, "\n") != 0 && strcmp(sentence, "\r") != 0 && strcmp(sentence, "\r\n") != 0)
+    while (*sentence == '\r' || *sentence == '\n') {
+        sentence++;
+    }
+    
+    if (*sentence) {
         return false;
+    }
 
     return true;
 }