aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-02-25 13:57:57 +0100
committerH. Peter Anvin <hpa@zytor.com>2009-02-25 20:58:45 -0800
commitffe6183ba3077a1004dfc2ecb43626bc9280b1e0 (patch)
tree3f9e08c71e94baac71280a4438a6ad5485c55e7d
parent502f3945957eda4f312704fa70a0e2fc53bbd6af (diff)
downloadsyslinux-elf-ffe6183ba3077a1004dfc2ecb43626bc9280b1e0.tar.gz
syslinux-elf-ffe6183ba3077a1004dfc2ecb43626bc9280b1e0.tar.xz
syslinux-elf-ffe6183ba3077a1004dfc2ecb43626bc9280b1e0.zip
hdt: Cleaning init
-rw-r--r--com32/modules/cpuid.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/com32/modules/cpuid.c b/com32/modules/cpuid.c
index 3105c962..4d6d46e4 100644
--- a/com32/modules/cpuid.c
+++ b/com32/modules/cpuid.c
@@ -311,8 +311,8 @@ void set_generic_info(struct cpuinfo_x86 *c,s_cpu *cpu) {
cpu->vendor_id=c->x86_vendor;
cpu->model_id=c->x86_model;
cpu->stepping=c->x86_mask;
- strncpy(cpu->vendor,cpu_devs[c->x86_vendor]->c_vendor,CPU_VENDOR_SIZE);
- strncpy(cpu->model,c->x86_model_id,CPU_MODEL_SIZE);
+ strncpy(cpu->vendor,cpu_devs[c->x86_vendor]->c_vendor,sizeof(cpu->vendor));
+ strncpy(cpu->model,c->x86_model_id,sizeof(cpu->model));
}
void detect_cpu(s_cpu *cpu)
@@ -323,11 +323,10 @@ void detect_cpu(s_cpu *cpu)
c.x86_vendor = X86_VENDOR_UNKNOWN;
c.cpuid_level = -1; /* CPUID not detected */
c.x86_model = c.x86_mask = 0; /* So far unknown... */
- c.x86_vendor_id[0] = '\0'; /* Unset */
- c.x86_model_id[0] = '\0'; /* Unset */
c.x86_max_cores = 1;
- memset(&c.x86_capability, 0, sizeof c.x86_capability);
- memset(&c.x86_vendor_id,'\0',CPU_VENDOR_SIZE);
+ memset(&c.x86_capability, 0, sizeof(c.x86_capability));
+ memset(&c.x86_vendor_id,0,sizeof(c.x86_vendor_id));
+ memset(&c.x86_model_id,0,sizeof(c.x86_model_id));
if (!have_cpuid_p())
return;