File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -71,8 +71,8 @@ $(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?
7373ifeq (,$(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;}' | \
75- $(CXX) -x c++ - -o $(BINDIR)/.have_strlcpy 2>/dev/null || ( echo -e '#!/bin/sh\nexit 1' > $(BINDIR)/.have_strlcpy ; chmod +x $(BINDIR)/.have_strlcpy; ))
74+ $(shell printf '# include <cstring>\nint main(){char a[4]{}; char b[4]{}; strlcpy(&a[0], &b[0], sizeof(a)); return 0;}\n ' | \
75+ $(CXX) -x c++ - -o $(BINDIR)/.have_strlcpy 2>/dev/null || ( printf '#!/bin/sh\nexit 1\n ' > $(BINDIR)/.have_strlcpy ; chmod +x $(BINDIR)/.have_strlcpy; ))
7676endif
7777
7878$(shell $(BINDIR)/.have_strlcpy)
@@ -81,8 +81,8 @@ FLAGS += -DSTRLCPY_MISSING
8181endif
8282
8383ifeq (,$(wildcard $(BINDIR ) /.have_strlcat) )
84- $(shell echo -e '# include <cstring>\nint main(){char a[4]{}; strlcat(&a[0], "test", sizeof(a)); return 0;}' | \
85- $(CXX) -x c++ - -o $(BINDIR)/.have_strlcat 2>/dev/null || ( echo -e '#!/bin/sh\nexit 1' > $(BINDIR)/.have_strlcat ; chmod +x $(BINDIR)/.have_strlcat; ))
84+ $(shell printf '# include <cstring>\nint main(){char a[4]{}; strlcat(&a[0], "test", sizeof(a)); return 0;}\n ' | \
85+ $(CXX) -x c++ - -o $(BINDIR)/.have_strlcat 2>/dev/null || ( printf '#!/bin/sh\nexit 1\n ' > $(BINDIR)/.have_strlcat ; chmod +x $(BINDIR)/.have_strlcat; ))
8686endif
8787
8888$(shell $(BINDIR)/.have_strlcat)
You can’t perform that action at this time.
0 commit comments