From 923b96fab87bceb0cd9d473c5f847abdcb588e31 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Tue, 8 Sep 2020 14:46:07 -0600 Subject: [PATCH] state: use lif_next_token() when parsing ifstate files --- libifupdown/state.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libifupdown/state.c b/libifupdown/state.c index a05e3dd..f130f05 100644 --- a/libifupdown/state.c +++ b/libifupdown/state.c @@ -16,14 +16,17 @@ #include #include "libifupdown/state.h" #include "libifupdown/fgetline.h" +#include "libifupdown/tokenize.h" bool lif_state_read(struct lif_dict *state, FILE *fd) { char linebuf[4096]; + char *bufp = linebuf; + while (lif_fgetline(linebuf, sizeof linebuf, fd)) { - char *ifname = linebuf; + char *ifname = lif_next_token(&bufp); char *equals_p = strchr(linebuf, '='); if (equals_p == NULL)