aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/config/commandParser.c
diff options
context:
space:
mode:
authorAngelo Mantellini <angelo.mantellini@cisco.com>2020-06-09 14:48:02 +0200
committerAngelo Mantellini <angelo.mantellini@cisco.com>2020-06-15 11:43:30 +0200
commit9e2c045d6118ef264d6cf8fc655b72d7c4c403dc (patch)
treed4156335f5ea69064e817b7c6536e0200c6421af /hicn-light/src/hicn/config/commandParser.c
parenta84ff82bb37ac53f20639d6e5e7f19d002459f31 (diff)
[HICN-626] Return output from libhicnlight
Signed-off-by: Angelo Mantellini <angelo.mantellini@cisco.com> Change-Id: I2351ce4dcefa1311fa09049f87e8317c8fe449f4
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);
}
}