You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/03/09 12:48:13 UTC

[GitHub] [mynewt-core] sjanc commented on a change in pull request #2165: FIx: advance_internal should return error instead of using assert

sjanc commented on a change in pull request #2165: FIx: advance_internal should return error instead of using assert
URL: https://github.com/apache/mynewt-core/pull/2165#discussion_r389637997
 
 

 ##########
 File path: encoding/tinycbor/src/cborparser.c
 ##########
 @@ -279,7 +279,9 @@ static CborError advance_internal(CborValue *it)
 {
     uint64_t length;
     CborError err = extract_number(it->parser, &it->offset,  &length);
-    assert(err == CborNoError);
+    if (err == CborNoError) {
+        return err;
+    }
 
 Review comment:
   hmm shouldn't if be !=  and not == ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services