diff options
author | Thomas White <taw@bitwiz.org.uk> | 2016-03-31 12:36:00 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2016-03-31 21:51:02 +0200 |
commit | 554a3d38045a2c563342b534084462771621e079 (patch) | |
tree | 1911b61b3fea65d82ac16853074519b4e1b5f7a7 /src/sc_editor.c | |
parent | 8e5fb26c9b5443edea16ed9a833761100aca7f58 (diff) |
Avoid a few segfaults
Diffstat (limited to 'src/sc_editor.c')
-rw-r--r-- | src/sc_editor.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c index 72e90e8..ca37853 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -583,6 +583,11 @@ static void insert_text(char *t, SCEditor *e) { Paragraph *para; + if ( e->cursor_frame == NULL ) { + fprintf(stderr, "Inserting text into no frame.\n"); + return; + } + if ( e->cursor_para >= e->cursor_frame->n_paras ) { fprintf(stderr, "Cursor paragraph number is too high!\n"); return; |