diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-06-24 14:35:45 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-06-24 14:35:45 +0000 |
commit | cf10df6c6805c8a4253b83a25997a7a41950f381 (patch) | |
tree | 6d131277d16be9bc57d980b83cadcd6b4cf13dd8 /lib | |
parent | 5b55dcbfbbeca0cc283fe5ea8422bd1d95af93cd (diff) | |
download | curl-cf10df6c6805c8a4253b83a25997a7a41950f381.tar.gz |
include header for our printfs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/escape.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/escape.c b/lib/escape.c index 00e2fae6e..18444d6a9 100644 --- a/lib/escape.c +++ b/lib/escape.c @@ -1,8 +1,8 @@ /*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al. @@ -10,7 +10,7 @@ * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. - * + * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. @@ -33,12 +33,15 @@ #include <string.h> #include "memory.h" +#define _MPRINTF_REPLACE /* use our functions only */ +#include <curl/mprintf.h> + /* The last #include file should be: */ #include "memdebug.h" char *curl_escape(const char *string, int length) { - size_t alloc = (length?(size_t)length:strlen(string))+1; + size_t alloc = (length?(size_t)length:strlen(string))+1; char *ns; char *testing_ptr = NULL; unsigned char in; @@ -93,10 +96,10 @@ char *curl_unescape(const char *string, int length) unsigned char in; int strindex=0; long hex; - + if( !ns ) return NULL; - + while(--alloc > 0) { in = *string; if(('%' == in) && ishex(string[1]) && ishex(string[2])) { @@ -113,7 +116,7 @@ char *curl_unescape(const char *string, int length) string+=2; alloc-=2; } - + ns[strindex++] = in; string++; } |