switch (string[i]) {
#ifndef WIN32
case '\'':
- /* We replace ' by sq dq sq dq sq, so need 4 additional bytes */
- dest_len += 4;
+ /* We replace ' by sq backslace sq sq, so need 3 additional bytes */
+ dest_len += 3;
break;
#endif
}
dest_len += 1; /* closing quote */
/* if we're given a pool, allocate from it, otherwise use malloc */
- if ( pool ) {
+ if (pool) {
dest = switch_core_alloc(pool, sizeof(char) * dest_len);
} else {
dest = (char *) malloc(sizeof(char) * dest_len);
break;
#else
case '\'':
- /* We replace ' by sq dq sq dq sq */
+ /* We replace ' by sq backslash sq sq */
dest[n++] = '\'';
- dest[n++] = '"';
+ dest[n++] = '\\';
dest[n++] = '\'';
- dest[n++] = '"';
dest[n++] = '\'';
break;
#endif