projects
/
project
/
iwinfo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dbc0ee7
)
utils: skip comment lines when parsing devices.txt
author
Andre Heider
<a.heider@gmail.com>
Wed, 18 Jan 2023 13:24:37 +0000
(14:24 +0100)
committer
Christian Marangi
<ansuelsmth@gmail.com>
Fri, 20 Jan 2023 15:08:00 +0000
(16:08 +0100)
Just a small optimization, skip the line early if it starts with a #.
Signed-off-by: Andre Heider <a.heider@gmail.com>
iwinfo_utils.c
patch
|
blob
|
history
diff --git
a/iwinfo_utils.c
b/iwinfo_utils.c
index ecd1dffb77ee0a812bcdeee2d5d0122cd6f2fb82..d96cbb345e68fb9b9a4d6edcc3067b5a192afd23 100644
(file)
--- 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[^\"]\"",