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:
parent
dbc0ee7c57
commit
c0fda7cf24
1 changed files with 3 additions and 0 deletions
|
@ -280,6 +280,9 @@ struct iwinfo_hardware_entry * iwinfo_hardware(struct iwinfo_hardware_id *id)
|
||||||
|
|
||||||
while (fgets(buf, sizeof(buf) - 1, db) != NULL)
|
while (fgets(buf, sizeof(buf) - 1, db) != NULL)
|
||||||
{
|
{
|
||||||
|
if (buf[0] == '#')
|
||||||
|
continue;
|
||||||
|
|
||||||
memset(&e, 0, sizeof(e));
|
memset(&e, 0, sizeof(e));
|
||||||
|
|
||||||
if (sscanf(buf, "%hx %hx %hx %hx %hd %hd \"%63[^\"]\" \"%63[^\"]\"",
|
if (sscanf(buf, "%hx %hx %hx %hx %hd %hd \"%63[^\"]\" \"%63[^\"]\"",
|
||||||
|
|
Loading…
Reference in a new issue