Line
Link Here
|
0 |
-- ./src/task-manager-linux.c.orig |
0 |
++ ./src/task-manager-linux.c |
Lines 128-134
Link Here
|
128 |
FILE *file; |
128 |
FILE *file; |
129 |
gchar filename[96]; |
129 |
gchar filename[96]; |
130 |
gint i; |
130 |
gint i; |
131 |
gchar c; |
131 |
gint c; |
132 |
|
132 |
|
133 |
snprintf (filename, 96, "/proc/%i/cmdline", task->pid); |
133 |
snprintf (filename, 96, "/proc/%i/cmdline", task->pid); |
134 |
if ((file = fopen (filename, "r")) == NULL) |
134 |
if ((file = fopen (filename, "r")) == NULL) |
Lines 136-142
Link Here
|
136 |
|
136 |
|
137 |
/* Read full command byte per byte until EOF */ |
137 |
/* Read full command byte per byte until EOF */ |
138 |
for (i = 0; (c = fgetc (file)) != EOF && i < (gint)sizeof (task->cmdline) - 1; i++) |
138 |
for (i = 0; (c = fgetc (file)) != EOF && i < (gint)sizeof (task->cmdline) - 1; i++) |
139 |
task->cmdline[i] = (c == '\0') ? ' ' : c; |
139 |
task->cmdline[i] = (c == '\0') ? ' ' : (gchar)c; |
140 |
task->cmdline[i] = '\0'; |
140 |
task->cmdline[i] = '\0'; |
141 |
if (task->cmdline[i-1] == ' ') |
141 |
if (task->cmdline[i-1] == ' ') |
142 |
task->cmdline[i-1] = '\0'; |
142 |
task->cmdline[i-1] = '\0'; |