Convert '\\n' -> '\r\n'

SVN revision: 1973
This commit is contained in:
2007-11-29 19:14:57 +00:00
parent 508a955fee
commit 93acb30c22
+18 -1
View File
@@ -257,6 +257,21 @@ void add_crlf(char *buffer, int bufsize)
/*------------------------------------------------------------------*/
void convert_crlf(char *buffer, int bufsize)
{
char *p;
/* convert '\n' -> \r\n */
p = buffer;
while ((p = strstr(p, "\\n")) != NULL) {
*(p++) = '\r';
*(p++) = '\n';
}
}
/*------------------------------------------------------------------*/
char request[100000], response[100000], *content;
INT retrieve_elog(char *host, int port, char *subdir, char *experiment,
@@ -1014,8 +1029,10 @@ int main(int argc, char *argv[])
printf("Multiple attributes and attachments can be supplied\n");
return 1;
}
} else
} else {
strcpy(text, argv[i]);
convert_crlf(text, sizeof(text));
}
}
}