summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2010-11-11 21:25:32 (GMT)
committerThomas Graf <tgraf@suug.ch>2010-11-11 21:25:32 (GMT)
commit2847cf081b88678a2bb780c59a2678131d47c11d (patch)
tree00b3f2617eedb9627b1edaca97241e54603d6b44 /lib
parent12b82e4f6f7eb52d249534b85f4634263567cd84 (diff)
downloadlibnl-2847cf081b88678a2bb780c59a2678131d47c11d.zip
libnl-2847cf081b88678a2bb780c59a2678131d47c11d.tar.gz
libnl-2847cf081b88678a2bb780c59a2678131d47c11d.tar.bz2
Make nl_str2af return a negative value if parsing fails
Diffstat (limited to 'lib')
-rw-r--r--lib/addr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/addr.c b/lib/addr.c
index 1f000e7..822821d 100644
--- a/lib/addr.c
+++ b/lib/addr.c
@@ -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;
}
/** @} */