basic: introduce *_to_string_with_check() functions

They are used in later commits.
This commit is contained in:
Yu Watanabe
2018-01-02 02:23:24 +09:00
parent 6f90844fe2
commit 33d12153da
5 changed files with 28 additions and 1 deletions
+2 -1
View File
@@ -283,7 +283,8 @@ int parse_errno(const char *t) {
if (r < 0)
return r;
if (e < 0 || e > ERRNO_MAX)
/* 0 is also allowed here */
if (!errno_is_valid(e) && e != 0)
return -ERANGE;
return e;