Lines Matching refs:dest
356 * line_to_buf(char *dest, const char *src) {
357 * appends src to dest, dynamically increasing the size of dest.
360 * if src is continuation of dest, dest != NULL, and
361 * the last character in dest before the newline must be a `\'
362 * if src is not continuation of dest, then dest must be NULL
365 line_to_buf(char *dest, const char *src)
370 if (dest == NULL) {
372 dest = malloc(sizeof (char) * (slen + 1));
373 if (dest == NULL) {
375 "Error: Unable to allocate memory for dest\n");
377 (void) strcpy(dest, src);
378 return (dest);
381 dlen = strlen(dest);
383 dest = realloc(dest, (size_t)(sizeof (char) * (dlen+slen+1)));
384 if (dest == NULL) {
386 "Error: Unable to allocate memory for dest\n");
394 if (dest[dlen-2] == '\\') {
395 dest[dlen-2] = ' ';
400 (void) strcat(dest, src);
402 return (dest);