mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-10 18:23:28 +00:00
Use stou instead of btou
SVN revision: 2202
This commit is contained in:
parent
99110e4467
commit
551822f80b
@ -182,13 +182,14 @@ size_t strlcat(char *dst, const char *src, size_t size)
|
|||||||
|
|
||||||
/*-------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------*/
|
||||||
|
|
||||||
void btou(char *str)
|
void stou(char *str)
|
||||||
/* convert all blanks to underscores in a string */
|
/* convert all special characters to underscores in a string */
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < (int) strlen(str); 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] = '_';
|
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++) {
|
for (i = 0; i < n_attr; i++) {
|
||||||
strcpy(str, attrib_name[i]);
|
strcpy(str, attrib_name[i]);
|
||||||
if (str[0]) {
|
if (str[0]) {
|
||||||
btou(str);
|
stou(str);
|
||||||
sprintf(content + strlen(content),
|
sprintf(content + strlen(content),
|
||||||
"%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n%s\r\n", boundary, str, attrib[i]);
|
"%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n%s\r\n", boundary, str, attrib[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user