aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest/lib552.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libtest/lib552.c')
-rw-r--r--tests/libtest/lib552.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/libtest/lib552.c b/tests/libtest/lib552.c
index 1c6e23455..ab097da3e 100644
--- a/tests/libtest/lib552.c
+++ b/tests/libtest/lib552.c
@@ -106,15 +106,15 @@ int my_trace(CURL *handle, curl_infotype type,
static size_t current_offset = 0;
-char data[70000]; /* MUST be more than 64k OR MAX_INITIAL_POST_SIZE */
+static char databuf[70000]; /* MUST be more than 64k OR MAX_INITIAL_POST_SIZE */
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
{
size_t amount = nmemb * size; /* Total bytes curl wants */
- size_t available = sizeof data - current_offset; /* What we have to give */
+ size_t available = sizeof(databuf) - current_offset; /* What we have to give */
size_t given = amount < available ? amount : available; /* What is given */
(void)stream;
- memcpy(ptr, data + current_offset, given);
+ memcpy(ptr, databuf + current_offset, given);
current_offset += given;
return given;
}
@@ -161,14 +161,14 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
/* setup repeated data string */
- for (i=0; i < sizeof data; ++i)
- data[i] = fill[i % sizeof fill];
+ for (i=0; i < sizeof(databuf); ++i)
+ databuf[i] = fill[i % sizeof fill];
/* Post */
curl_easy_setopt(curl, CURLOPT_POST, 1L);
/* Setup read callback */
- curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof data);
+ curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof(databuf));
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
/* Write callback */