From 6ad623a3f77e087e308f334525fd4046811f2a9a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 2 Nov 2015 23:57:21 +0100 Subject: 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. --- src/machine/machine.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/machine') diff --git a/src/machine/machine.c b/src/machine/machine.c index d88b7c90df..cbc03640c1 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -332,9 +332,7 @@ int machine_load(Machine *m) { break; } - if (safe_atoi(word, &ifi) < 0) - continue; - if (ifi <= 0) + if (parse_ifindex(word, &ifi) < 0) continue; if (!GREEDY_REALLOC(ni, allocated, nr+1)) { -- cgit v1.2.3-54-g00ecf