From 2a3bd726baaf9400c62ab8f658d104c5e680f049 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 23 Nov 2023 18:29:38 +0100 Subject: [PATCH] byte_array: don't use OAI assertions.h, requires exit_function() Using AssertFatal() has the drawback that it requires the definition of an exit_function() (which is typically declared in OAI main executables). We don't want to pull in such dependency for every consumer. Hence, use c stdlib's assert() instead. --- common/utils/ds/byte_array.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/utils/ds/byte_array.c b/common/utils/ds/byte_array.c index c3281ffa27..78e1ef4e31 100644 --- a/common/utils/ds/byte_array.c +++ b/common/utils/ds/byte_array.c @@ -21,7 +21,6 @@ #include "byte_array.h" -#include "common/utils/assertions.h" #include #include @@ -29,7 +28,7 @@ byte_array_t copy_byte_array(byte_array_t src) { byte_array_t dst = {0}; dst.buf = malloc(src.len); - AssertFatal(dst.buf != NULL, "Memory exhausted"); + assert(dst.buf != NULL && "Memory exhausted"); memcpy(dst.buf, src.buf, src.len); dst.len = src.len; return dst;