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:
[email protected]
With regards,
Apache Git Services