summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/machdep.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index 4c3c9faf28b..f6f99419ffb 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.552 2014/10/17 01:46:26 dlg Exp $ */
+/* $OpenBSD: machdep.c,v 1.553 2014/10/17 18:15:48 kettenis Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -1815,7 +1815,7 @@ identifycpu(struct cpu_info *ci)
}
}
- /* Remove leading and duplicated spaces from cpu_brandstr */
+ /* Remove leading, trailing and duplicated spaces from cpu_brandstr */
brandstr_from = brandstr_to = cpu_brandstr;
skipspace = 1;
while (*brandstr_from != '\0') {
@@ -1827,6 +1827,8 @@ identifycpu(struct cpu_info *ci)
skipspace = 1;
brandstr_from++;
}
+ if (skipspace && brandstr_to > cpu_brandstr)
+ brandstr_to--;
*brandstr_to = '\0';
if (cpu_brandstr[0] == '\0') {