Copy the string first, since shell_output_str() does not ensure constness of the first string

ico
Adam Dunkels 2011-08-31 22:03:31 +02:00
parent add8367947
commit 4e5d3217ca
1 changed files with 3 additions and 1 deletions

View File

@ -58,7 +58,9 @@ PROCESS_THREAD(shell_ps_process, ev, data)
shell_output_str(&ps_command, "Processes:", "");
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();