]> git.ozlabs.org Git - ccan/commitdiff
cpuid: use a hardcoded constant when comparing CPU names
authorA. Samy <f.fallen45@gmail.com>
Sat, 15 Aug 2015 01:06:12 +0000 (01:06 +0000)
committerA. Samy <f.fallen45@gmail.com>
Sat, 15 Aug 2015 01:06:12 +0000 (01:06 +0000)
Signed-off-by: A. Samy <f.fallen45@gmail.com>
ccan/cpuid/cpuid.c

index c3a2da707e9e0669d87a77f9b9b57dc4730a7e5e..9a42d83e948d715232a1440f7f20271ca18a5ae7 100644 (file)
@@ -238,7 +238,7 @@ cputype_t cpuid_get_cpu_type(void)
 
                get_cpuid(CPUID_VENDORID, &i, &u.bufu32[0], &u.bufu32[2], &u.bufu32[1]);
                for (i = 0; i < sizeof(c_cpunames) / sizeof(c_cpunames); ++i) {
-                       if (strncmp(c_cpunames[i], u.buf, sizeof(c_cpunames[0])) == 0) {
+                       if (strncmp(c_cpunames[i], u.buf, 12) == 0) {
                                cputype = (cputype_t)i;
                                break;
                        }