From 146d6870264bb2b913cbeb24bf4f8fe42a4d9522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Wed, 21 Sep 2022 19:09:05 +0200 Subject: [PATCH] cpu_type.h: remove vendor string at any place MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix bug #17951 Change-Id: Icc0ac964ff9c6322612dadb459d28a97ac69e91a Reviewed-on: https://review.haiku-os.org/c/haiku/+/5686 Tested-by: Commit checker robot Reviewed-by: Jérôme Duval --- headers/private/shared/cpu_type.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/headers/private/shared/cpu_type.h b/headers/private/shared/cpu_type.h index cce198d7d2..62fe96b531 100644 --- a/headers/private/shared/cpu_type.h +++ b/headers/private/shared/cpu_type.h @@ -48,17 +48,19 @@ parse_intel(const char* name) break; } - // ignore vendor - for (; name[index] != '\0'; index++) { - if (name[index] == ' ') { - index++; - break; - } - } // parse model int outIndex = 0; for (; name[index] != '\0'; index++) { + // ignore vendor + if (strncmp(&name[index], "Intel", 5) == 0) { + for (; name[index] != '\0'; index++) { + if (name[index] == ' ') { + index++; + break; + } + } + } if (!strncmp(&name[index], "(R)", 3)) { outIndex += strlcpy(&buffer[outIndex], "®", sizeof(buffer) - outIndex);