diff options
author | Anthony J. Bentley <anthony@cathet.us> | 2013-04-26 19:01:28 -0600 |
---|---|---|
committer | Vincent Sanders <vincent.sanders@collabora.co.uk> | 2013-04-27 08:26:54 +0100 |
commit | 652ef30ea4e99e7ae38277304a53ee82e458eb28 (patch) | |
tree | 4655ff9e97ec0ed3df36a902cf1b7ab411c978b8 /test | |
parent | 79645bfda9c6fd8a7580d527f290cf440e7796f0 (diff) | |
download | libcss-652ef30ea4e99e7ae38277304a53ee82e458eb28.tar.gz |
Don't use the nonportable alloca() during tests.
Diffstat (limited to 'test')
-rw-r--r-- | test/css21.c | 4 | ||||
-rw-r--r-- | test/parse-auto.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/test/css21.c b/test/css21.c index ddc629c..7a2997a 100644 --- a/test/css21.c +++ b/test/css21.c @@ -115,7 +115,7 @@ int main(int argc, char **argv) if (error == CSS_OK) { css_stylesheet *import; - char *buf = alloca(lwc_string_length(url) + 1); + char *buf = malloc(lwc_string_length(url) + 1); memcpy(buf, lwc_string_data(url), lwc_string_length(url)); @@ -135,6 +135,8 @@ int main(int argc, char **argv) css_stylesheet_destroy(import); error = CSS_IMPORTS_PENDING; + + free(buf); } } diff --git a/test/parse-auto.c b/test/parse-auto.c index 156c38d..0549f45 100644 --- a/test/parse-auto.c +++ b/test/parse-auto.c @@ -409,7 +409,7 @@ void run_test(const uint8_t *data, size_t len, exp_entry *exp, size_t explen) if (error == CSS_OK) { css_stylesheet *import; - char *buf = alloca(lwc_string_length(url) + 1); + char *buf = malloc(lwc_string_length(url) + 1); memcpy(buf, lwc_string_data(url), lwc_string_length(url)); @@ -425,6 +425,8 @@ void run_test(const uint8_t *data, size_t len, exp_entry *exp, size_t explen) error = CSS_IMPORTS_PENDING; lwc_string_unref(url); + + free(buf); } } |