From 9e2c045d6118ef264d6cf8fc655b72d7c4c403dc Mon Sep 17 00:00:00 2001 From: Angelo Mantellini Date: Tue, 9 Jun 2020 14:48:02 +0200 Subject: [HICN-626] Return output from libhicnlight Signed-off-by: Angelo Mantellini Change-Id: I2351ce4dcefa1311fa09049f87e8317c8fe449f4 --- hicn-light/src/hicn/config/commandParser.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'hicn-light/src/hicn/config/commandParser.c') 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); } } -- cgit 1.2.3-korg