fix: remove atoi redundancy
This commit is contained in:
@@ -30,7 +30,7 @@ int *get_running_processes(int *count) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
strtol(entry->d_name, &endptr, 10);
|
long pid = strtol(entry->d_name, &endptr, 10);
|
||||||
if (*endptr != '\0') {
|
if (*endptr != '\0') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -47,7 +47,7 @@ int *get_running_processes(int *count) {
|
|||||||
}
|
}
|
||||||
processes = grown;
|
processes = grown;
|
||||||
}
|
}
|
||||||
processes[(*count)++] = atoi(entry->d_name);
|
processes[(*count)++] = (int)pid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user