mirror of
https://github.com/anrieff/libcpuid
synced 2024-12-26 16:55:45 +00:00
Fix scanf() format for 'logical_cpu' in cpuid_deserialize_raw_data_internal()
logical_cpu is an uint16_t, so SCNu16 is the correct format. It was providing strange values with SCNi16, like with the Intel® Xeon® Platinum 8280 dump.
This commit is contained in:
parent
25c83f0d0b
commit
543c3ac17d
2 changed files with 9 additions and 9 deletions
|
@ -806,7 +806,7 @@ static int cpuid_deserialize_raw_data_internal(struct cpu_raw_data_t* single_raw
|
|||
}
|
||||
|
||||
if (is_libcpuid_dump) {
|
||||
if (use_raw_array && (sscanf(line, "_________________ Logical CPU #%" SCNi16 " _________________", &logical_cpu) >= 1)) {
|
||||
if (use_raw_array && (sscanf(line, "_________________ Logical CPU #%" SCNu16 " _________________", &logical_cpu) >= 1)) {
|
||||
debugf(2, "Parsing raw dump for logical CPU %i\n", logical_cpu);
|
||||
is_header = false;
|
||||
cpuid_grow_raw_data_array(raw_array, logical_cpu + 1);
|
||||
|
@ -887,9 +887,9 @@ static int cpuid_deserialize_raw_data_internal(struct cpu_raw_data_t* single_raw
|
|||
}
|
||||
}
|
||||
else if (is_aida64_dump) {
|
||||
if (use_raw_array && ((sscanf(line, "------[ Logical CPU #%" SCNi16 " ]------", &logical_cpu) >= 1) ||
|
||||
(sscanf(line, "------[ CPUID Registers / Logical CPU #%" SCNi16 " ]------", &logical_cpu) >= 1) ||
|
||||
(sscanf(line, "CPU#%" SCNi16 " AffMask: 0x%*x", &logical_cpu) >= 1))) {
|
||||
if (use_raw_array && ((sscanf(line, "------[ Logical CPU #%" SCNu16 " ]------", &logical_cpu) >= 1) ||
|
||||
(sscanf(line, "------[ CPUID Registers / Logical CPU #%" SCNu16 " ]------", &logical_cpu) >= 1) ||
|
||||
(sscanf(line, "CPU#%" SCNu16 " AffMask: 0x%*x", &logical_cpu) >= 1))) {
|
||||
debugf(2, "Parsing AIDA64 raw dump for logical CPU %i\n", logical_cpu);
|
||||
cpuid_grow_raw_data_array(raw_array, logical_cpu + 1);
|
||||
raw_ptr = &raw_array->raw[logical_cpu];
|
||||
|
|
|
@ -2751,8 +2751,8 @@ general
|
|||
7
|
||||
6
|
||||
85
|
||||
26
|
||||
46
|
||||
28
|
||||
56
|
||||
32
|
||||
32
|
||||
1024
|
||||
|
@ -2768,9 +2768,9 @@ general
|
|||
64
|
||||
64
|
||||
-1
|
||||
26
|
||||
26
|
||||
26
|
||||
28
|
||||
28
|
||||
28
|
||||
1
|
||||
0
|
||||
128 (non-authoritative)
|
||||
|
|
Loading…
Reference in a new issue