aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-11-19 21:07:38 +0100
committerThomas White <taw@physics.org>2017-11-19 21:07:38 +0100
commitcad7675852e8f2fd556b38b8e376913daca2f10a (patch)
tree13d1cc9c2209cec060df7c590ab7e1bc53d9ff97
parent81b068ebc0841b9716543da99627092396ffa613 (diff)
Remove unnecessary newline stuff
-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 */