From: Jens Axboe Date: Fri, 14 Feb 2014 15:48:22 +0000 (-0700) Subject: Fix early termination of cpu id string X-Git-Tag: fio-2.1.6~36 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=81fa6e06408879509e005cbb192205b9125f7614 Fix early termination of cpu id string Commit 2d60ad8e terminated the cpu id string at 12 chars, but the output from cpuid is 12 chars. So we need one more character, if we want it null terminated and strcmp() working. Signed-off-by: Jens Axboe --- diff --git a/arch/arch-x86-common.h b/arch/arch-x86-common.h index 26a14a82..31aa79f1 100644 --- a/arch/arch-x86-common.h +++ b/arch/arch-x86-common.h @@ -54,13 +54,13 @@ static inline int arch_init_amd(unsigned int level) static inline int arch_init(char *envp[]) { unsigned int level; - char str[12]; + char str[13]; cpuid(0, &level, (unsigned int *) &str[0], (unsigned int *) &str[8], (unsigned int *) &str[4]); - str[11] = '\0'; + str[12] = '\0'; if (!strcmp(str, "GenuineIntel")) tsc_reliable = arch_init_intel(level); else if (!strcmp(str, "AuthenticAMD"))