summaryrefslogtreecommitdiff
path: root/dmioem.c
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2020-12-10 11:21:49 +0100
committerJean Delvare <jdelvare@suse.de>2020-12-10 11:21:49 +0100
commit3c111e4f6134855580f20f8e01fee26eff455fff (patch)
treed9fab31044819244d69e381504c9671e1e18c954 /dmioem.c
parent0a2387acbb477ef5d79679c66a6ffa6e990274c5 (diff)
downloaddmidecode-git-3c111e4f6134855580f20f8e01fee26eff455fff.tar.gz
dmidecode: Use _dmi_string for dmi_set_vendor
The strings passed to dmi_set_vendor will never be printed, they are used for comparison purposes only, so the pre- and post-processing done by dmi_string is not needed. Call _dmi_string instead, which is faster. Signed-off-by: Jean Delvare <jdelvare@suse.de>
Diffstat (limited to 'dmioem.c')
-rw-r--r--dmioem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dmioem.c b/dmioem.c
index 217850e..180a95d 100644
--- a/dmioem.c
+++ b/dmioem.c
@@ -68,7 +68,7 @@ void dmi_set_vendor(const char *v, const char *p)
* Often DMI strings have trailing spaces. Ignore these
* when checking for known vendor names.
*/
- len = strlen(v);
+ len = v ? strlen(v) : 0;
while (len && v[len - 1] == ' ')
len--;