Correctly link function

ran_func_kpm.c uses cp_ba_to_str(), but it is not defined in OAI. Define
it so we can link properly, instead of relying on FlexRIC (where it was
defined).
This commit is contained in:
Robert Schmidt
2025-01-27 07:45:39 +01:00
parent 10e07bc67f
commit 8eca2e0591
4 changed files with 18 additions and 2 deletions
+14
View File
@@ -72,3 +72,17 @@ byte_array_t cp_str_to_ba(const char* str)
return dst;
}
char* cp_ba_to_str(const byte_array_t ba)
{
assert(ba.len > 0);
const size_t sz = ba.len;
char* str = calloc(sz+1, sizeof(char));
assert(str != NULL && "Memory exhausted");
memcpy(str, ba.buf, sz);
str[sz] = '\0';
return str;
}