X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=encode.c;h=6cb57cf5aa72c9bab88651c78f6f567fb8e1f718;hp=d7418eeb582a4d56e8b921f24b2107ea5838e00f;hb=5d67369224f780b21d94cacf31dbcdf288c7ed6c;hpb=8675bc0559b182e88e9dfbfd98cc9c9f8717cf0b diff --git a/encode.c b/encode.c index d7418eeb..6cb57cf5 100644 --- a/encode.c +++ b/encode.c @@ -1,4 +1,3 @@ -const char encode_rcs[] = "$Id: encode.c,v 1.26 2012/03/09 16:24:36 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/encode.c,v $ @@ -7,7 +6,7 @@ const char encode_rcs[] = "$Id: encode.c,v 1.26 2012/03/09 16:24:36 fabiankeil E * encode cookies and HTML text. * * Copyright : Written by and Copyright (C) 2001 the - * Privoxy team. http://www.privoxy.org/ + * Privoxy team. https://www.privoxy.org/ * * Based on the Internet Junkbuster originally written * by and Copyright (C) 1997 Anonymous Coders and @@ -44,10 +43,8 @@ const char encode_rcs[] = "$Id: encode.c,v 1.26 2012/03/09 16:24:36 fabiankeil E #include "miscutil.h" #include "encode.h" -const char encode_h_rcs[] = ENCODE_H_VERSION; - /* Maps special characters in a URL to their equivalent % codes. */ -static const char const url_code_map[256][4] = { +static const char url_code_map[256][4] = { "", "%01", "%02", "%03", "%04", "%05", "%06", "%07", "%08", "%09", "%0A", "%0B", "%0C", "%0D", "%0E", "%0F", "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17", "%18", "%19", "%1A", "%1B", "%1C", "%1D", @@ -158,9 +155,10 @@ char * html_encode(const char *s) } *p = '\0'; + + assert(strlen(buf) < buf_size); } - assert(strlen(buf) < buf_size); return(buf); } @@ -253,9 +251,9 @@ char * url_encode(const char *s) *p = '\0'; + assert(strlen(buf) < buf_size); } - assert(strlen(buf) < buf_size); return(buf); } @@ -448,9 +446,9 @@ char *percent_encode_url(const char *s) } } *p = '\0'; - } - assert(strlen(buf) < buf_size); + assert(strlen(buf) < buf_size); + } return(buf);