I did some thinking and the best I could come up with in a short amount of time is this:
char* destroycrlf(char* original)
{
char *ret, *token, sep[] = "\r";
ret = (char *)calloc(strlen(original) * 7 + 8,sizeof(char));
token = strtok( original, sep );
sprintf(ret ,"<p>" );
while (token) {
if (token[0] == '\n')
sprintf(ret, "%s<\\p><p>%s", ret, &token[1]);
else
sprintf(ret, "%s%s", ret, token);
token = strtok( NULL, sep );
}
sprintf(ret, "%s<\\p>", ret);
return ret;
}
Maybe not the shortest, but it should work and is fairly quick.