From 7247b98d45d906b297b3f307c26ff9bd322ad51d Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Fri, 14 Feb 2020 12:34:23 -0800 Subject: [PATCH] wsutil: Strip the processor brand string. The processor brand string returned by CPUID is left-padded in some cases. For example, adding g_warning("==>%s<==\n", CPUBrandString); to get_cpu_info() on a test machine here returns ** (tshark.exe:3808): WARNING **: ==> Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz<== Make sure it's stripped before we add it to our version information. Change-Id: Idf9f9574477043a5e7fe4ff1ecb7890d6da90e0a Reviewed-on: https://code.wireshark.org/review/36108 Reviewed-by: Gerald Combs Petri-Dish: Gerald Combs Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- wsutil/cpu_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wsutil/cpu_info.c b/wsutil/cpu_info.c index 810b48628c..9dd42f623a 100644 --- a/wsutil/cpu_info.c +++ b/wsutil/cpu_info.c @@ -51,7 +51,7 @@ get_cpu_info(GString *str) if (str->len > 0) g_string_append(str, ", with "); - g_string_append_printf(str, "%s", CPUBrandString); + g_string_append_printf(str, "%s", g_strstrip(CPUBrandString)); if (ws_cpuid_sse42()) g_string_append(str, " (with SSE4.2)");