aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/config/commandParser.c
diff options
context:
space:
mode:
authorAngelo Mantellini <angelo.mantellini@cisco.com>2020-06-15 10:02:57 +0000
committerGerrit Code Review <gerrit@fd.io>2020-06-15 10:02:57 +0000
commit961352d7801c4f4bbee2990690b7d5ac5e3c88d6 (patch)
tree20f3915fa8220caec629cfbc1dd918acc359e0e4 /hicn-light/src/hicn/config/commandParser.c
parent0f3841ea94ed9019a538516d774f5936b301e9a0 (diff)
parent9e2c045d6118ef264d6cf8fc655b72d7c4c403dc (diff)
Merge "[HICN-626] Return output from libhicnlight"
Diffstat (limited to 'hicn-light/src/hicn/config/commandParser.c')
-rw-r--r--hicn-light/src/hicn/config/commandParser.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/hicn-light/src/hicn/config/commandParser.c b/hicn-light/src/hicn/config/commandParser.c
index fa3269c9a..f4652fe39 100644
--- a/hicn-light/src/hicn/config/commandParser.c
+++ b/hicn-light/src/hicn/config/commandParser.c
@@ -201,14 +201,17 @@ static CommandOps *commandParser_MatchCommand(CommandParser *state,
}
CommandReturn commandParser_DispatchCommand(CommandParser *state,
- PARCList *args) {
+ PARCList *args,
+ char *output,
+ size_t output_size) {
+ parcAssertNotNull(output, "output buffer is null\n");
CommandOps *ops = commandParser_MatchCommand(state, args);
if (ops == NULL) {
- printf("Command not found.\n");
+ snprintf(output, output_size, "Command not found.\n");
return CommandReturn_Failure;
} else {
- return ops->execute(state, ops, args);
+ return ops->execute(state, ops, args, output, output_size);
}
}