From 70ddb405197f3db76db4a1e4a5ad5b9d8bb6ec09 Mon Sep 17 00:00:00 2001 From: Yakun Xu Date: Thu, 27 Aug 2020 14:02:37 +0800 Subject: [PATCH] [diag] clear output in case no output given (#5465) The stop command doesn't write anything to the output buffer. --- src/core/diags/factory_diags.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/diags/factory_diags.cpp b/src/core/diags/factory_diags.cpp index fc41cc92d..482fe2e8a 100644 --- a/src/core/diags/factory_diags.cpp +++ b/src/core/diags/factory_diags.cpp @@ -535,7 +535,7 @@ exit: switch (error) { case OT_ERROR_NONE: - + aOutput[0] = '\0'; // In case there is no output. IgnoreError(ProcessCmd(argCount, &aArgsector[0], aOutput, aOutputMaxLen)); break;