未验证 提交 86510aa2 编写于 作者: J jackyu2020 提交者: GitHub

check the return value of fscanf (#2218)

Signed-off-by: Ne <ych05zh@163.com>
上级 ed2ee887
......@@ -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);
}
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册