Just a small optimization, skip the line early if it starts with a #.

Signed-off-by: Andre Heider <a.hei...@gmail.com>
---
 iwinfo_utils.c | 3 +++
 1 file changed, 3 insertions(+)

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[^\"]\"",
-- 
2.39.0


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to