mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
check the return value of fscanf (#2218)
Signed-off-by: e <ych05zh@163.com>
This commit is contained in:
parent
ed2ee8873b
commit
86510aa295
@ -318,8 +318,9 @@ SystemInfo::CPUTemperature() {
|
||||
return result;
|
||||
}
|
||||
float temp;
|
||||
fscanf(file, "%f", &temp);
|
||||
result.push_back(temp / 1000);
|
||||
if (fscanf(file, "%f", &temp) != -1) {
|
||||
result.push_back(temp / 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user