diff options
Diffstat (limited to 'libc/cpu.c')
-rw-r--r-- | libc/cpu.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -54,7 +54,7 @@ void cpuid(int code, u32 *a, u32 *b, u32 *c, u32 *d) __asm__ volatile("cpuid" : "=a"(*a), "=b"(*b), "=c"(*c), "=d"(*d) : "a"(code)); } -char *cpu_string(char buf[12]) +char *cpu_string(char buf[13]) { u32 a, b, c, d; cpuid(CPUID_VENDOR_STRING, &a, &b, &c, &d); @@ -73,12 +73,13 @@ char *cpu_string(char buf[12]) buf[9] = ecx[1]; buf[10] = ecx[2]; buf[11] = ecx[3]; + buf[12] = 0; return buf; } void cpu_print() { - char buf[12] = { 0 }; + char buf[13] = { 0 }; printf("%s\n", cpu_string(buf)); } |