straycat corner sandbox/mbloch/straycat
authorMichal Bloch <m.bloch@samsung.com>
Tue, 18 Jan 2022 16:16:42 +0000 (17:16 +0100)
committerMichal Bloch <m.bloch@samsung.com>
Tue, 18 Jan 2022 16:33:44 +0000 (17:33 +0100)
Change-Id: I4c498a0758e42ee88cade6b9f4c57d99b00885cb
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
packaging/linux-tizen-modules-source.spec
tests/kdbus/kdbus-test.h

index a614f34d11de5a78d9ab1662fa3f6ac12cf4fc58..339163e00cfff9338501ffa21b74d97f11f3cf9b 100644 (file)
@@ -25,6 +25,8 @@ Group:          System/Kernel
 Provides:       linux-kernel-kdbus-tests
 Provides:       linux-kernel-logger-tests
 BuildRequires:  pkgconfig(libcap)
+BuildRequires:  ??? bsd/string.h
+
 %description    -n linux-tizen-modules-tests
 This package contains tests for Tizen-specific kernel modules.
 
index e0a6abc65c1f877ab8a6960e4646bed9d4b43b41..36950ae8dd6d192f6d4c6178c8fe05960d21179e 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <pthread.h>
 #include <sys/syscall.h>
+#include <bsd/string.h>
 #include "kdbus-util.h"
 
 struct kdbus_test_env {
@@ -44,11 +45,11 @@ enum {
        if (!(_ASSERT_RETURN_VAL_val0_ relop _ASSERT_RETURN_VAL_val1_)) {                       \
                /* must assemble format string in runtime because _Generic does not play well with string constant concatenation */\
                char _ASSERT_REL_fmt_[sizeof("[tid %u] Assertion '(")+3+sizeof("=%s) %s (")+3+sizeof("=%s)' failed in %s(), %s:%d\n")];\
-               strcpy(_ASSERT_REL_fmt_, "[tid %u] Assertion '(");\
-               strcat(_ASSERT_REL_fmt_, PRINTF_FMT(_ASSERT_RETURN_VAL_val0_));\
-               strcat(_ASSERT_REL_fmt_, "=%s) %s (");\
-               strcat(_ASSERT_REL_fmt_, PRINTF_FMT(_ASSERT_RETURN_VAL_val1_));\
-               strcat(_ASSERT_REL_fmt_, "=%s)' failed in %s(), %s:%d\n");\
+               strlcpy(_ASSERT_REL_fmt_, "[tid %u] Assertion '("             , sizeof _ASSERT_REL_fmt_);\
+               strlcat(_ASSERT_REL_fmt_, PRINTF_FMT(_ASSERT_RETURN_VAL_val0_), sizeof _ASSERT_REL_fmt_);\
+               strlcat(_ASSERT_REL_fmt_, "=%s) %s ("                         , sizeof _ASSERT_REL_fmt_);\
+               strlcat(_ASSERT_REL_fmt_, PRINTF_FMT(_ASSERT_RETURN_VAL_val1_), sizeof _ASSERT_REL_fmt_);\
+               strlcat(_ASSERT_REL_fmt_, "=%s)' failed in %s(), %s:%d\n"     , sizeof _ASSERT_REL_fmt_);\
                print(_ASSERT_REL_fmt_, syscall(SYS_gettid), PRINTF_ARG(_ASSERT_RETURN_VAL_val0_), val0s, #relop, PRINTF_ARG(_ASSERT_RETURN_VAL_val1_), val1s, __func__, __FILE__, __LINE__);\
                onfailure;\
        }\