Skip to content

Commit ebe3651

Browse files
Flavio Ceolincfriedt
authored andcommitted
tests: mbedtls: Fix GCC warning about test_snprintf
Fix errors like: inlined from ‘test_mbedtls’ at zephyrproject/zephyr/tests/crypto/mbedtls/src/mbedtls.c:172:6: zephyrproject/zephyr/tests/crypto/mbedtls/src/mbedtls.c:96:17: error: ‘test_snprintf’ reading 10 bytes from a region of size 1 [-Werror=stringop-overread] 96 | test_snprintf(1, "", -1) != 0 || | ^~~~~~~~~~~~~~~~~~~~~~~~ In GCC >= 11 because `ret_buf` in some calls are shorter literals Signed-off-by: Flavio Ceolin <[email protected]>
1 parent 1b7c720 commit ebe3651

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/crypto/mbedtls/src/mbedtls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
#include "mbedtls/memory_buffer_alloc.h"
7373
#endif
7474

75-
static int test_snprintf(size_t n, const char ref_buf[10], int ref_ret)
75+
static int test_snprintf(size_t n, const char *ref_buf, int ref_ret)
7676
{
7777
int ret;
7878
char buf[10] = "xxxxxxxxx";

0 commit comments

Comments
 (0)