diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-11-02 23:57:21 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-11-03 00:02:00 +0100 |
commit | 6ad623a3f77e087e308f334525fd4046811f2a9a (patch) | |
tree | 1030c9d7eb6e88cc605c36ed50901d4527a4fcf1 /src/libsystemd/sd-login/sd-login.c | |
parent | 6a37c684695befff2d2ce7e0fcce90e25e2e252c (diff) |
parse-util: introduce parse_ifindex() and make use of it everywhere
We have enough places where we parse an ifindex, hence introduce a
proper parsing function for it, that verifies all parameters.
Diffstat (limited to 'src/libsystemd/sd-login/sd-login.c')
-rw-r--r-- | src/libsystemd/sd-login/sd-login.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libsystemd/sd-login/sd-login.c b/src/libsystemd/sd-login/sd-login.c index cd766c3f91..3f2e459825 100644 --- a/src/libsystemd/sd-login/sd-login.c +++ b/src/libsystemd/sd-login/sd-login.c @@ -932,9 +932,7 @@ _public_ int sd_machine_get_ifindices(const char *machine, int **ifindices) { *(char*) (mempcpy(buf, word, l)) = 0; - if (safe_atoi(buf, &ifi) < 0) - continue; - if (ifi <= 0) + if (parse_ifindex(buf, &ifi) < 0) continue; if (!GREEDY_REALLOC(ni, allocated, nr+1)) { |