fix: correct memset call

This commit is contained in:
6arelyFuture 2023-07-22 10:06:14 +02:00
parent 26f496dee9
commit bd0ebd28be
Signed by: Future
GPG Key ID: FA77F074E98D98A5
2 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,7 @@ if os.getenv("CI") then
end end
filter "configurations:Release" filter "configurations:Release"
optimize "Speed" optimize "Size"
defines "NDEBUG" defines "NDEBUG"
flags "FatalCompileWarnings" flags "FatalCompileWarnings"
filter {} filter {}

View File

@ -108,7 +108,7 @@ static int is_process_wild(int curr_real_mem, int peak_real_mem,
} }
int setup(const char* pid) { int setup(const char* pid) {
memset(&processes, 0, sizeof(struct process_monitor)); memset(&processes, 0, sizeof(processes));
char* command = va("pgrep %s", pid); char* command = va("pgrep %s", pid);
FILE* file = popen(command, "r"); FILE* file = popen(command, "r");
@ -123,7 +123,7 @@ int setup(const char* pid) {
int i = 0; int i = 0;
while (fgets(result, BUFFER_SIZE, file) && i < MAX_TRACK_SIZE) { while (fgets(result, BUFFER_SIZE, file) && i < MAX_TRACK_SIZE) {
printf("Process ID: %s", result); printf("Process ID: %s", result);
processes[i].id = atoi(result); processes[i].id = strtol(result, NULL, 10);
processes[i].active = 1; processes[i].active = 1;
++i; ++i;