From 3eda944db5a314c94e63210c7f787cf870f53b2e Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 10 Jun 2017 10:50:25 +0200 Subject: [PATCH] device.c, #15/19, make use of 'wl_find()' --- src/frontend/device.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/frontend/device.c b/src/frontend/device.c index 6c79fd830..fa6f18bcd 100644 --- a/src/frontend/device.c +++ b/src/frontend/device.c @@ -1210,16 +1210,8 @@ com_alter_common(wordlist *wl, int do_model) wl = parent->wl_next; /* Everything is ready, parsing of the wordlist starts here. */ - words = wl; - while (words) { - p = words->wl_word; - eqword = words; - words = words->wl_next; - if (eq(p, "=")) - break; - } - - if (!words) { + eqword = wl_find("=", wl); + if (!eqword || !eqword->wl_next) { fprintf(cp_err, "Error: no assignment found.\n"); fprintf(cp_err, "Cannot alter parameters.\n"); return;