[diags] use temporary buffer for diag output (#2992)

This commit is contained in:
Shu Chen
2018-08-29 00:24:23 +08:00
committed by Jonathan Hui
parent 2f605e9953
commit 026badad96
7 changed files with 70 additions and 75 deletions
+5 -1
View File
@@ -3466,8 +3466,12 @@ exit:
#if OPENTHREAD_ENABLE_DIAG
void Interpreter::ProcessDiag(int argc, char *argv[])
{
char output[OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE];
// all diagnostics related features are processed within diagnostics module
mServer->OutputFormat("%s\r\n", otDiagProcessCmd(argc, argv));
output[sizeof(output) - 1] = '\0';
otDiagProcessCmd(argc, argv, output, sizeof(output) - 1);
mServer->OutputFormat("%s\n", output);
}
#endif