mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 07:50:40 +01:00
[v1.06] Replace emalloc+memset with ecalloc when possible. Refactor some memory allocation code
This commit is contained in:
@@ -13,7 +13,7 @@ bool fill_array_from_sys(int *core_ids, int total_cores, char* SYS_PATH) {
|
||||
char* buf;
|
||||
char* end;
|
||||
char path[128];
|
||||
memset(path, 0, 128);
|
||||
memset(name, 0, sizeof(char) * 128);
|
||||
|
||||
for(int i=0; i < total_cores; i++) {
|
||||
sprintf(path, "%s%s/cpu%d/%s", _PATH_SYS_SYSTEM, _PATH_SYS_CPU, i, SYS_PATH);
|
||||
|
||||
Reference in New Issue
Block a user