mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 07:50:40 +01:00
[v0.98][Refactoring] Unify the use of unknown string
This commit is contained in:
@@ -37,11 +37,9 @@ static char *hv_vendors_name[] = {
|
||||
[HV_VENDOR_VMWARE] = "VMware",
|
||||
[HV_VENDOR_XEN] = "Xen",
|
||||
[HV_VENDOR_PARALLELS] = "Parallels",
|
||||
[HV_VENDOR_INVALID] = "Unknown"
|
||||
[HV_VENDOR_INVALID] = STRING_UNKNOWN
|
||||
};
|
||||
|
||||
#define STRING_UNKNOWN "Unknown"
|
||||
|
||||
#define HYPERVISOR_NAME_MAX_LENGTH 17
|
||||
|
||||
#define MASK 0xFF
|
||||
@@ -305,8 +303,8 @@ struct cpuInfo* get_cpu_info() {
|
||||
cpu->cpu_name = get_str_cpu_name_internal();
|
||||
}
|
||||
else {
|
||||
cpu->cpu_name = emalloc(sizeof(char)*8);
|
||||
sprintf(cpu->cpu_name,"Unknown");
|
||||
cpu->cpu_name = emalloc(sizeof(char) * (strlen(STRING_UNKNOWN) + 1));
|
||||
strcpy(cpu->cpu_name, STRING_UNKNOWN);
|
||||
printWarn("Can't read cpu name from cpuid (needed extended level is 0x%.8X, max is 0x%.8X)", 0x80000004, cpu->maxExtendedLevels);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user