From 551822f80b9156beac13f771d6ea8ca2ddd62917 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Thu, 28 May 2009 08:42:40 +0000 Subject: [PATCH] Use stou instead of btou SVN revision: 2202 --- src/elog.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/elog.c b/src/elog.c index 8ae1b2a2..76501ca7 100755 --- a/src/elog.c +++ b/src/elog.c @@ -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]); }