Use stou instead of btou

SVN revision: 2202
This commit is contained in:
2009-05-28 08:42:40 +00:00
parent 99110e4467
commit 551822f80b
+5 -4
View File
@@ -182,13 +182,14 @@ size_t strlcat(char *dst, const char *src, size_t size)
/*-------------------------------------------------------------------*/
void btou(char *str)
/* convert all blanks to underscores in a string */
void stou(char *str)
/* convert all special characters to underscores in a string */
{
int i;
for (i = 0; i < (int) strlen(str); i++)
if (str[i] == ' ')
if (str[i] == ' ' || str[i] == '.' || str[i] == '/' ||
str[i] == '\\' || str[i] == '-' || str[i] == '(' || str[i] == ')')
str[i] = '_';
}
@@ -834,7 +835,7 @@ INT submit_elog(char *host, int port, int ssl, char *subdir, char *experiment,
for (i = 0; i < n_attr; i++) {
strcpy(str, attrib_name[i]);
if (str[0]) {
btou(str);
stou(str);
sprintf(content + strlen(content),
"%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n%s\r\n", boundary, str, attrib[i]);
}