From 60d867a978d167d17c59ec58fc70a36a4c4027a0 Mon Sep 17 00:00:00 2001
From: rmagueta <rmagueta@allbesmart.pt>
Date: Fri, 29 Sep 2023 16:05:34 +0100
Subject: [PATCH] Fix read servingCellConfigDedicated from config file

---
 openair2/GNB_APP/gnb_config.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c
index b2ae0039b7..c142462404 100644
--- a/openair2/GNB_APP/gnb_config.c
+++ b/openair2/GNB_APP/gnb_config.c
@@ -997,11 +997,13 @@ static NR_ServingCellConfigCommon_t *get_scc_config(int minRXTXTIME)
 
 static NR_ServingCellConfig_t *get_scd_config(void)
 {
-  char aprefix[MAX_OPTNAME_SIZE*2 + 8];
   NR_ServingCellConfig_t *scd = calloc(1, sizeof(*scd));
   prepare_scd(scd);
   paramdef_t SCDsParams[] = SCDPARAMS_DESC(scd);
   paramlist_def_t SCDsParamList = {GNB_CONFIG_STRING_SERVINGCELLCONFIGDEDICATED, NULL, 0};
+
+  char aprefix[MAX_OPTNAME_SIZE * 2 + 8];
+  snprintf(aprefix, sizeof(aprefix), "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
   config_getlist(&SCDsParamList, NULL, 0, aprefix);
   if (SCDsParamList.numelt > 0) {
     sprintf(aprefix, "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0, GNB_CONFIG_STRING_SERVINGCELLCONFIGDEDICATED, 0);
-- 
2.26.2