From cad7675852e8f2fd556b38b8e376913daca2f10a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sun, 19 Nov 2017 21:07:38 +0100 Subject: Remove unnecessary newline stuff --- src/sc_editor.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src') diff --git a/src/sc_editor.c b/src/sc_editor.c index 3139294..4d152b1 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -776,11 +776,6 @@ static void insert_text(char *t, SCEditor *e) } else { SCBlock *ad; - char *tmp; - - tmp = malloc(strlen(t)+2); - strcpy(tmp, "\n"); - strcat(tmp, t); /* FIXME: We should not assume that box void pointers correspond * to "real" scblocks for callback paragraphs. Not in this @@ -792,7 +787,7 @@ static void insert_text(char *t, SCEditor *e) } /* No. Create a new text paragraph straight afterwards */ - sc_block_insert_after(ad, NULL, NULL, tmp); + sc_block_insert_after(ad, NULL, NULL, strdup(t)); full_rerender(e); /* FIXME: Find the cursor again */ -- cgit v1.2.3