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
|
end
|
||||||
|
|
||||||
filter "configurations:Release"
|
filter "configurations:Release"
|
||||||
optimize "Speed"
|
optimize "Size"
|
||||||
defines "NDEBUG"
|
defines "NDEBUG"
|
||||||
flags "FatalCompileWarnings"
|
flags "FatalCompileWarnings"
|
||||||
filter {}
|
filter {}
|
||||||
|
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user