aboutsummaryrefslogtreecommitdiff
path: root/hardinfo
diff options
context:
space:
mode:
Diffstat (limited to 'hardinfo')
-rw-r--r--hardinfo/vendor.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hardinfo/vendor.c b/hardinfo/vendor.c
index 86705e10..f73781c3 100644
--- a/hardinfo/vendor.c
+++ b/hardinfo/vendor.c
@@ -121,11 +121,12 @@ static GSList *vendor_list = NULL;
/* sort the vendor list by length of match_string,
* LONGEST first */
gint vendor_sort (gconstpointer a, gconstpointer b) {
+ const Vendor *ap = a, *bp = b;
int la = 0, lb = 0;
- if (a) la = strlen(a);
- if (b) lb = strlen(b);
- if (a == b) return 0;
- if (a > b) return -1;
+ if (ap && ap->match_string) la = strlen(ap->match_string);
+ if (bp && bp->match_string) lb = strlen(bp->match_string);
+ if (la == lb) return 0;
+ if (la > lb) return -1;
return 1;
}