From: Andre Heider Date: Wed, 18 Jan 2023 13:24:37 +0000 (+0100) Subject: utils: skip comment lines when parsing devices.txt X-Git-Url: http://git.openwrt.org/ubox.git?a=commitdiff_plain;h=c0fda7cf249008315a52093a81beae440b2ed005;p=project%2Fiwinfo.git utils: skip comment lines when parsing devices.txt Just a small optimization, skip the line early if it starts with a #. Signed-off-by: Andre Heider --- diff --git a/iwinfo_utils.c b/iwinfo_utils.c index ecd1dff..d96cbb3 100644 --- a/iwinfo_utils.c +++ b/iwinfo_utils.c @@ -280,6 +280,9 @@ struct iwinfo_hardware_entry * iwinfo_hardware(struct iwinfo_hardware_id *id) while (fgets(buf, sizeof(buf) - 1, db) != NULL) { + if (buf[0] == '#') + continue; + memset(&e, 0, sizeof(e)); if (sscanf(buf, "%hx %hx %hx %hx %hd %hd \"%63[^\"]\" \"%63[^\"]\"",