1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-23 16:48:49 -05:00

test543: extended to verify zero length input

As was reported in #5601
This commit is contained in:
Daniel Stenberg 2020-06-24 15:24:35 +02:00
parent 32defc3197
commit 79d8099ff0
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 15 additions and 3 deletions

View File

@ -30,6 +30,8 @@ curl_easy_escape
<verify> <verify>
<stdout> <stdout>
%9C%26K%3DI%04%A1%01%E0%D8%7C%20%B7%EFS%29%FA%1DW%E1 %9C%26K%3DI%04%A1%01%E0%D8%7C%20%B7%EFS%29%FA%1DW%E1
IN: '' OUT: ''
IN: ' 12' OUT: '%2012'
</stdout> </stdout>
</verify> </verify>
</testcase> </testcase>

View File

@ -49,11 +49,21 @@ int test(char *URL)
s = curl_easy_escape(easy, (const char *)a, asize); s = curl_easy_escape(easy, (const char *)a, asize);
if(s) if(s) {
printf("%s\n", s); printf("%s\n", s);
if(s)
curl_free(s); curl_free(s);
}
s = curl_easy_escape(easy, "", 0);
if(s) {
printf("IN: '' OUT: '%s'\n", s);
curl_free(s);
}
s = curl_easy_escape(easy, " 123", 3);
if(s) {
printf("IN: ' 12' OUT: '%s'\n", s);
curl_free(s);
}
curl_easy_cleanup(easy); curl_easy_cleanup(easy);
curl_global_cleanup(); curl_global_cleanup();