lib543.c
Go to the documentation of this file.
1 /***************************************************************************
2  * _ _ ____ _
3  * Project ___| | | | _ \| |
4  * / __| | | | |_) | |
5  * | (__| |_| | _ <| |___
6  * \___|\___/|_| \_\_____|
7  *
8  * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
9  *
10  * This software is licensed as described in the file COPYING, which
11  * you should have received as part of this distribution. The terms
12  * are also available at https://curl.haxx.se/docs/copyright.html.
13  *
14  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15  * copies of the Software, and permit persons to whom the Software is
16  * furnished to do so, under the terms of the COPYING file.
17  *
18  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19  * KIND, either express or implied.
20  *
21  ***************************************************************************/
22 /* Based on Alex Fishman's bug report on September 30, 2007 */
23 
24 #include "test.h"
25 
26 #include "memdebug.h"
27 
28 int test(char *URL)
29 {
30  static const unsigned char a[] = {
31  0x9c, 0x26, 0x4b, 0x3d, 0x49, 0x4, 0xa1, 0x1,
32  0xe0, 0xd8, 0x7c, 0x20, 0xb7, 0xef, 0x53, 0x29, 0xfa,
33  0x1d, 0x57, 0xe1};
34 
35  CURL *easy;
36  int asize;
37  char *s;
39  (void)URL;
40 
42  easy = curl_easy_init();
43  if(!easy) {
44  fprintf(stderr, "curl_easy_init() failed\n");
45  return TEST_ERR_MAJOR_BAD;
46  }
47 
48  asize = (int)sizeof(a);
49 
50  s = curl_easy_escape(easy, (const char *)a, asize);
51 
52  if(s)
53  printf("%s\n", s);
54 
55  if(s)
56  curl_free(s);
57 
58  curl_easy_cleanup(easy);
60 
61  return 0;
62 }
int test(char *URL)
Definition: lib543.c:28
CURL_EXTERN void curl_free(void *p)
Definition: escape.c:239
CURL_EXTERN char * curl_easy_escape(CURL *handle, const char *string, int length)
#define global_init(A)
Definition: test.h:431
XmlRpcServer s
CURLcode
Definition: curl.h:454
static int res
#define TEST_ERR_MAJOR_BAD
Definition: test.h:85
#define printf
Definition: curl_printf.h:40
Definition: unit1323.c:36
CURL_EXTERN CURL * curl_easy_init(void)
Definition: easy.c:343
CURL_EXTERN void curl_easy_cleanup(CURL *curl)
Definition: curl.h:455
void CURL
Definition: curl.h:102
#define fprintf
Definition: curl_printf.h:41
static CURL * easy[MAX_EASY_HANDLES]
CURL_EXTERN void curl_global_cleanup(void)
curl_global_cleanup() globally cleanups curl, uses the value of "init_flags" to determine what needs ...
Definition: easy.c:312
#define CURL_GLOBAL_ALL
Definition: curl.h:2519


rc_tagdetect_client
Author(s): Monika Florek-Jasinska , Raphael Schaller
autogenerated on Sat Feb 13 2021 03:42:15