[v1.06] Replace emalloc+memset with ecalloc when possible. Refactor some memory allocation code

This commit is contained in:
Dr-Noob
2024-08-24 15:32:33 +01:00
parent 025e28c516
commit 40374121b8
10 changed files with 19 additions and 32 deletions

View File

@@ -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);