From c3ee794d40bdfbe41b5628bb8da6e41bc68bbac0 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 29 Oct 2023 13:39:14 +0100 Subject: Small change on cpuid stuffs --- src/tools/my_cpuid.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/tools') diff --git a/src/tools/my_cpuid.c b/src/tools/my_cpuid.c index 9bf8cd82..6039f135 100644 --- a/src/tools/my_cpuid.c +++ b/src/tools/my_cpuid.c @@ -159,10 +159,6 @@ const char* getBoxCpuName() snprintf(branding, sizeof(branding), "Box64 on %.*s @%04d MHz", 28, name, MHz); } } - while(strlen(branding)<3*4*4) { - memmove(branding+1, branding, strlen(branding)); - branding[0] = ' '; - } } return branding; } @@ -173,7 +169,12 @@ void my_cpuid(x64emu_t* emu, uint32_t tmp32u) int ncpu = getNCpu(); if(ncpu>255) ncpu = 255; if(!ncpu) ncpu = 1; - const char* branding = getBoxCpuName(); + static char branding[3*4*4+1] = ""; + strcpy(branding, getBoxCpuName()); + while(strlen(branding)<3*4*4) { + memmove(branding+1, branding, strlen(branding)); + branding[0] = ' '; + } switch(tmp32u) { case 0x0: // emulate a P4. TODO: Emulate a Core2? -- cgit 1.4.1