diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-10-17 18:15:49 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-10-17 18:15:49 +0000 |
commit | bbd1ed2e546f7fcef3b41f9a2564d8fce925c1e9 (patch) | |
tree | c0b5438e6a36a75a19dd88a71fd38bb9c8843014 /sys/arch/i386 | |
parent | 9f3d7e19f26a48ba0a4b05fe590d4a76077a4ced (diff) |
Also remove trailing spaces from the CPU brand string.
ok deraadt@, armani@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/i386/machdep.c | 6 |
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') { |