aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sc_editor.c7
1 files changed, 1 insertions, 6 deletions
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 */