Copy the string first, since shell_output_str() does not ensure constness of the first string
This commit is contained in:
parent
add8367947
commit
4e5d3217ca
|
@ -58,7 +58,9 @@ PROCESS_THREAD(shell_ps_process, ev, data)
|
||||||
|
|
||||||
shell_output_str(&ps_command, "Processes:", "");
|
shell_output_str(&ps_command, "Processes:", "");
|
||||||
for(p = PROCESS_LIST(); p != NULL; p = p->next) {
|
for(p = PROCESS_LIST(); p != NULL; p = p->next) {
|
||||||
shell_output_str(&ps_command, PROCESS_NAME_STRING(p), "");
|
char namebuf[30];
|
||||||
|
strncpy(namebuf, PROCESS_NAME_STRING(p), sizeof(namebuf));
|
||||||
|
shell_output_str(&ps_command, namebuf, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
PROCESS_END();
|
PROCESS_END();
|
||||||
|
|
Loading…
Reference in a new issue