fix: coding style
This commit is contained in:
parent
efbae5b7d6
commit
ae7fdf2f94
5 changed files with 13 additions and 11 deletions
|
|
@ -14,7 +14,8 @@ cli_parse_int64(const char *s, int64_t *out)
|
||||||
errno = 0;
|
errno = 0;
|
||||||
const intmax_t v = strtoimax(s, &end, 10);
|
const intmax_t v = strtoimax(s, &end, 10);
|
||||||
|
|
||||||
if (s == end || ERANGE == errno || '\0' != *end || v < INT64_MIN || v > INT64_MAX)
|
if (s == end || ERANGE == errno || '\0' != *end || v < INT64_MIN
|
||||||
|
|| v > INT64_MAX)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
*out = (int64_t)v;
|
*out = (int64_t)v;
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,8 @@ cli_parse_ufloat(const char *s, float *out)
|
||||||
errno = 0;
|
errno = 0;
|
||||||
float v = strtof(s, &end);
|
float v = strtof(s, &end);
|
||||||
|
|
||||||
if (s == end || ERANGE == errno || '\0' != *end || 0 == isfinite(v) || v < 0.0f)
|
if (s == end || ERANGE == errno || '\0' != *end || 0 == isfinite(v)
|
||||||
|
|| v < 0.0f)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
*out = v;
|
*out = v;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue