Skip to content

Commit c950f7d

Browse files
committed
cleanup: fix unterminated string warning.
1 parent 3d47370 commit c950f7d

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
CC?=gcc
22
CFLAGS:=-Wall -Werror -Wextra -I. -D_GNU_SOURCE
33
CFLAGS+=-g -ggdb -Wdeclaration-after-statement
4-
CFLAGS+=-Wno-error=unterminated-string-initialization
54
LDFLAGS+=-pthread
65

76
# Debug flags:

src/test/ipfilter_logger.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ static int tot_sent = 0;
3333
static int tot_recv = 0;
3434
static int wolfIP_closing = 0;
3535
static int closed = 0;
36-
static const uint8_t test_pattern[16] = "Test pattern - -";
36+
/* "Test pattern - -" 16 chars without trailing null. */
37+
static const uint8_t test_pattern[16] = {0x54, 0x65, 0x73, 0x74, 0x20, 0x70,
38+
0x61, 0x74, 0x74, 0x65, 0x72, 0x6e,
39+
0x20, 0x2d, 0x20, 0x2d};
3740

3841
static WOLFSSL_CTX *server_ctx = NULL; /* Used by wolfIP */
3942
static WOLFSSL_CTX *client_ctx = NULL; /* Used by Linux */

src/test/test_native_wolfssl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ static int tot_sent = 0;
4444
static int tot_recv = 0;
4545
static int wolfIP_closing = 0;
4646
static int closed = 0;
47-
static const uint8_t test_pattern[16] = "Test pattern - -";
47+
/* "Test pattern - -" 16 chars without trailing null. */
48+
static const uint8_t test_pattern[16] = {0x54, 0x65, 0x73, 0x74, 0x20, 0x70,
49+
0x61, 0x74, 0x74, 0x65, 0x72, 0x6e,
50+
0x20, 0x2d, 0x20, 0x2d};
4851

4952
static WOLFSSL_CTX *server_ctx = NULL; /* Used by wolfIP */
5053
static WOLFSSL_CTX *client_ctx = NULL; /* Used by Linux */

0 commit comments

Comments
 (0)