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 <a.heider@gmail.com>
This commit is contained in:
Andre Heider 2023-01-18 14:24:37 +01:00 committed by Christian Marangi
parent dbc0ee7c57
commit c0fda7cf24
No known key found for this signature in database
GPG key ID: AC001D09ADBFEAD7

View file

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