From 3c111e4f6134855580f20f8e01fee26eff455fff Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 10 Dec 2020 11:21:49 +0100 Subject: 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 --- dmioem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dmioem.c') 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--; -- cgit v1.2.1