mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-14 04:54:37 +03:00
Security review: check results of snprintf.
Calls marked with xSnprintf shouldn't fail. Abort program cleanly if any of them does.
This commit is contained in:
@ -52,7 +52,7 @@ Panel* AffinityPanel_new(ProcessList* pl, Affinity* affinity) {
|
||||
int curCpu = 0;
|
||||
for (int i = 0; i < pl->cpuCount; i++) {
|
||||
char number[10];
|
||||
snprintf(number, 9, "%d", Settings_cpuId(pl->settings, i));
|
||||
xSnprintf(number, 9, "%d", Settings_cpuId(pl->settings, i));
|
||||
bool mode;
|
||||
if (curCpu < affinity->used && affinity->cpus[curCpu] == i) {
|
||||
mode = true;
|
||||
|
Reference in New Issue
Block a user