Make nl_str2af return a negative value if parsing fails
This commit is contained in:
parent
12b82e4f6f
commit
2847cf081b
1 changed files with 1 additions and 1 deletions
|
@ -921,7 +921,7 @@ char *nl_af2str(int family, char *buf, size_t size)
|
|||
int nl_str2af(const char *name)
|
||||
{
|
||||
int fam = __str2type(name, afs, ARRAY_SIZE(afs));
|
||||
return fam >= 0 ? fam : AF_UNSPEC;
|
||||
return fam >= 0 ? fam : -EINVAL;
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
|
Loading…
Add table
Reference in a new issue