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 2018/08/20 23:12:31 UTC

[GitHub] ccollins476ad commented on a change in pull request #1341: sys/console: add support for silencing output from the console

ccollins476ad commented on a change in pull request #1341: sys/console: add support for silencing output from the console
URL: https://github.com/apache/mynewt-core/pull/1341#discussion_r211433679
 
 

 ##########
 File path: util/parse/src/parse.c
 ##########
 @@ -62,6 +62,13 @@ parse_ll_bounds(const char *sval, long long min, long long max,
         return llval;
     }
 
+    if (llval < min || llval > max)
+    {
+        *out_status = SYS_ERANGE;
 
 Review comment:
   I like the idea of returning `SYS_ERANGE` if the value is out of range.  Now these functions are comparing against min and max twice, though.  You should be able to move this comparison up immediately after the call to `strtoll()`, and then remove the second comparison.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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