mirror of
https://github.com/diamante0018/MonitorRam.git
synced 2025-05-09 22:14:54 +00:00
fix: correct memset call
This commit is contained in:
parent
26f496dee9
commit
bd0ebd28be
@ -36,7 +36,7 @@ if os.getenv("CI") then
|
||||
end
|
||||
|
||||
filter "configurations:Release"
|
||||
optimize "Speed"
|
||||
optimize "Size"
|
||||
defines "NDEBUG"
|
||||
flags "FatalCompileWarnings"
|
||||
filter {}
|
||||
|
@ -108,7 +108,7 @@ static int is_process_wild(int curr_real_mem, int peak_real_mem,
|
||||
}
|
||||
|
||||
int setup(const char* pid) {
|
||||
memset(&processes, 0, sizeof(struct process_monitor));
|
||||
memset(&processes, 0, sizeof(processes));
|
||||
|
||||
char* command = va("pgrep %s", pid);
|
||||
FILE* file = popen(command, "r");
|
||||
@ -123,7 +123,7 @@ int setup(const char* pid) {
|
||||
int i = 0;
|
||||
while (fgets(result, BUFFER_SIZE, file) && i < MAX_TRACK_SIZE) {
|
||||
printf("Process ID: %s", result);
|
||||
processes[i].id = atoi(result);
|
||||
processes[i].id = strtol(result, NULL, 10);
|
||||
processes[i].active = 1;
|
||||
|
||||
++i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user