Browse code

Always USE_TABLE now

git-svn: trunk@1490

Nigel Horne authored on 2005/04/24 19:01:15
Showing 1 changed files
... ...
@@ -15,7 +15,7 @@
15 15
  *  along with this program; if not, write to the Free Software
16 16
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 17
  */
18
-static	char	const	rcsid[] = "$Id: message.c,v 1.153 2005/04/21 11:12:06 nigelhorne Exp $";
18
+static	char	const	rcsid[] = "$Id: message.c,v 1.154 2005/04/24 10:01:15 nigelhorne Exp $";
19 19
 
20 20
 #if HAVE_CONFIG_H
21 21
 #include "clamav-config.h"
... ...
@@ -117,9 +117,6 @@ static	struct	mime_map {
117 117
 	{	NULL,			TEXT		}
118 118
 };
119 119
 
120
-#define	USE_TABLE	/* table driven base64 decoder */
121
-
122
-#ifdef	USE_TABLE
123 120
 /*
124 121
  * See RFC2045, section 6.8, table 1
125 122
  */
... ...
@@ -141,7 +138,6 @@ static const unsigned char base64Table[256] = {
141 141
 	255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
142 142
 	255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
143 143
 };
144
-#endif
145 144
 
146 145
 message *
147 146
 messageCreate(void)
... ...
@@ -1955,7 +1951,6 @@ decodeLine(message *m, encoding_type et, const char *line, unsigned char *buf, s
1955 1955
 static void
1956 1956
 sanitiseBase64(char *s)
1957 1957
 {
1958
-#ifdef	USE_TABLE
1959 1958
 	/*cli_dbgmsg("sanitiseBase64 '%s'\n", s);*/
1960 1959
 	for(; *s; s++)
1961 1960
 		if(base64Table[(unsigned int)(*s & 0xFF)] == 255) {
... ...
@@ -1964,26 +1959,6 @@ sanitiseBase64(char *s)
1964 1964
 			for(p1 = s; p1[0] != '\0'; p1++)
1965 1965
 				p1[0] = p1[1];
1966 1966
 		}
1967
-#else
1968
-	for(; *s; s++) {
1969
-		char *p1;
1970
-		char c = *s;
1971
-
1972
-		if(isupper(c))
1973
-			continue;
1974
-		if(isdigit(c))
1975
-			continue;
1976
-		if(c == '+')
1977
-			continue;
1978
-		if(c == '/')
1979
-			continue;
1980
-		if(islower(c))
1981
-			continue;
1982
-
1983
-		for(p1 = s; p1[0] != '\0'; p1++)
1984
-			p1[0] = p1[1];
1985
-	}
1986
-#endif
1987 1967
 }
1988 1968
 
1989 1969
 /*
... ...
@@ -2168,7 +2143,6 @@ hex(char c)
2168 2168
 	return '=';
2169 2169
 }
2170 2170
 
2171
-#ifdef	USE_TABLE
2172 2171
 static unsigned char
2173 2172
 base64(char c)
2174 2173
 {
... ...
@@ -2180,25 +2154,6 @@ base64(char c)
2180 2180
 	}
2181 2181
 	return ret;
2182 2182
 }
2183
-#else
2184
-static unsigned char
2185
-base64(char c)
2186
-{
2187
-	if(isupper(c))
2188
-		return c - 'A';
2189
-	if(isdigit(c))
2190
-		return c - '0' + 52;
2191
-	if(c == '+')
2192
-		return 62;
2193
-	if(islower(c))	/* call last, most base64 is upper case */
2194
-		return c - 'a' + 26;
2195
-
2196
-	if(c != '/')
2197
-		cli_dbgmsg("Illegal character <%c> in base64 encoding\n", c);
2198
-
2199
-	return 63;
2200
-}
2201
-#endif
2202 2183
 
2203 2184
 static unsigned char
2204 2185
 uudecode(char c)