mirror of
https://github.com/curl/curl.git
synced 2026-08-24 14:03:35 +03:00
parent
c2fed8c669
commit
37ac4498ee
1 changed files with 6 additions and 7 deletions
|
|
@ -49,7 +49,7 @@ static CURLcode test_unit2604(const char *arg)
|
|||
/* 540 a's */
|
||||
#define SA540 SA60 SA60 SA60 SA60 SA60 SA60 SA60 SA60 SA60
|
||||
int i;
|
||||
size_t too_long = 90720;
|
||||
const size_t too_long = 90720;
|
||||
struct set list[] = {
|
||||
{ "-too-long-", "", "", "", CURLE_TOO_LARGE},
|
||||
{ SA540 " c", SA540, "c", "/", CURLE_OK},
|
||||
|
|
@ -75,13 +75,13 @@ static CURLcode test_unit2604(const char *arg)
|
|||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
list[0].cp = calloc(1, too_long + 1);
|
||||
fail_unless(list[0].cp, "could not alloc too long value");
|
||||
memset(CURL_UNCONST(list[0].cp), 'a', too_long);
|
||||
char *cp0 = calloc(1, too_long + 1);
|
||||
fail_unless(cp0, "could not alloc too long value");
|
||||
memset(cp0, 'a', too_long);
|
||||
|
||||
for(i = 0; list[i].home; i++) {
|
||||
char *path;
|
||||
const char *cp = list[i].cp;
|
||||
const char *cp = i == 0 ? cp0 : list[i].cp;
|
||||
CURLcode result = Curl_get_pathname(&cp, &path, list[i].home);
|
||||
printf("%u - Curl_get_pathname(\"%s\", ... \"%s\") == %u\n", i,
|
||||
list[i].cp, list[i].home, list[i].result);
|
||||
|
|
@ -101,11 +101,10 @@ static CURLcode test_unit2604(const char *arg)
|
|||
unitfail++;
|
||||
}
|
||||
curl_free(path);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
free(CURL_UNCONST(list[0].cp));
|
||||
free(cp0);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue