summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Meyering <christophe.meyering@gmail.com>2020-01-31 22:05:13 -0800
committerAmadeusz Sławiński <amade@asmblr.net>2020-02-02 00:39:39 +0100
commitb2fb626a3876cf6abe19848d83630aabfba23f95 (patch)
tree5ac16557bb6c856e390cbc0a9fad9ac0b3670260
parent2703529ade1e52428bf87d4839bd73674e79ffd8 (diff)
downloadscreen-b2fb626a3876cf6abe19848d83630aabfba23f95.tar.gz
build: tests/test-winmsgbuf.c: avoid GCC 10 alloca warning
* src/tests/test-winmsgbuf.c (main): Replace alloca with malloc/free to prevent the following warning: tests/test-winmsgbuf.c:298:19:\ warning: implicit declaration of function ‘alloca’; did you mean \ ‘calloc’?
-rw-r--r--src/tests/test-winmsgbuf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tests/test-winmsgbuf.c b/src/tests/test-winmsgbuf.c
index 681d81c..acf8386 100644
--- a/src/tests/test-winmsgbuf.c
+++ b/src/tests/test-winmsgbuf.c
@@ -295,7 +295,7 @@ int main(void)
* concatenation */
char *add = "bar";
size_t szadd = strlen(add);
- char *expect2 = alloca(strlen(expect) + szadd + 1);
+ char *expect2 = malloc(strlen(expect) + szadd + 1);
strcpy(expect2, expect);
strcat(expect2, add);
ASSERT(wmbc_printf(wmbc, "%s", add) == (int)szadd);
@@ -322,6 +322,7 @@ int main(void)
wmbc_free(wmbc);
wmb_free(wmb);
+ free(expect2);
}
/* scenerio: merging the contents of two separate buffers, also