From 01c0c3769ee0c01303cc42a9496b0d0caf47bfbb Mon Sep 17 00:00:00 2001 From: Amin Ben Romdhane Date: Tue, 28 Nov 2023 13:20:23 +0000 Subject: [PATCH] Get method: Show only the first resolved reference for micro-service object --- libbbfdm-api/dmbbf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libbbfdm-api/dmbbf.c b/libbbfdm-api/dmbbf.c index ac532b8e..6da35fc5 100644 --- a/libbbfdm-api/dmbbf.c +++ b/libbbfdm-api/dmbbf.c @@ -858,7 +858,6 @@ static char *get_value_by_reference(struct dmctx *ctx, char *value) char buf[MAX_DM_PATH * 4] = {0}; char buf_val[MAX_DM_PATH * 4] = {0}; bool path_resolved = false; - unsigned pos = 0; if (DM_STRLEN(value) == 0 || !DM_STRSTR(value, "==")) return value; @@ -895,12 +894,12 @@ static char *get_value_by_reference(struct dmctx *ctx, char *value) if (DM_STRLEN(val)) { path_resolved = true; - pos += snprintf(&buf_val[pos], sizeof(buf_val) - pos, "%s,", val); + snprintf(buf_val, sizeof(buf_val), "%s", val); + break; } } if (path_resolved) { - buf_val[pos - 1] = 0; return dmstrdup(buf_val); }