Skip to content

Commit 0a114d3

Browse files
committed
fix strlen calls
1 parent d6e539e commit 0a114d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/host/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ $(shell mkdir -p $(BINDIR))
7171
# Core files sometimes override libc functions, check when necessary to hide them
7272
# TODO proper configure script / other build system?
7373
ifeq (,$(wildcard $(BINDIR)/.have_strlcpy))
74-
$(shell echo -e '#include <cstring>\nint main(){char a[4]; char b[4]; strlcpy(&a[0], &b[0], sizeof(a)); return 0;}' | \
74+
$(shell echo -e '#include <cstring>\nint main(){char a[4]{}; char b[4]{}; strlcpy(&a[0], &b[0], sizeof(a)); return 0;}' | \
7575
$(CXX) -x c++ - -o $(BINDIR)/.have_strlcpy 2>/dev/null || { echo -e '#!/bin/sh\nexit 1' > $(BINDIR)/.have_strlcpy ; chmod +x $(BINDIR)/.have_strlcpy; })
7676
endif
7777

@@ -81,7 +81,7 @@ FLAGS += -DHAVE_STRLCPY
8181
endif
8282

8383
ifeq (,$(wildcard $(BINDIR)/.have_strlcat))
84-
$(shell echo -e '#include <cstring>\nint main(){char a[4]; strlcat(&a[0], "test", sizeof(a)); return 0;}' | \
84+
$(shell echo -e '#include <cstring>\nint main(){char a[4]{}; strlcat(&a[0], "test", sizeof(a)); return 0;}' | \
8585
$(CXX) -x c++ - -o $(BINDIR)/.have_strlcat 2>/dev/null || { echo -e '#!/bin/sh\nexit 1' > $(BINDIR)/.have_strlcat ; chmod +x $(BINDIR)/.have_strlcat; })
8686
endif
8787

0 commit comments

Comments
 (0)