Is there a standard C library function to escape C-strings?
For example, if I had the C string:
char example[] = \"first line\\nsecond line: \\\"inne
while(*src++) { if(*src == '\\' || *src == '\"' || *src == '\'') *dest++ = '\\'; *dest++ = *src++; }