From c56a39fc9bda020f6c5c862bcf7c9455e0d83459 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 29 Mar 2016 22:56:07 +0200 Subject: Enable text insertion --- src/sc_parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sc_parse.c') diff --git a/src/sc_parse.c b/src/sc_parse.c index 60a03ff..95b5c76 100644 --- a/src/sc_parse.c +++ b/src/sc_parse.c @@ -554,7 +554,7 @@ SCBlock *find_last_child(SCBlock *bl) } -void sc_insert_text(SCBlock *b1, int o1, const char *t) +void sc_insert_text(SCBlock *b1, size_t o1, const char *t) { if ( b1->contents == NULL ) { b1->contents = strdup(t); @@ -563,7 +563,7 @@ void sc_insert_text(SCBlock *b1, int o1, const char *t) size_t len = strlen(b1->contents)+1+strlen(t); char *cnew = realloc(b1->contents, len); char *tmp = malloc(len); - char *p1 = g_utf8_offset_to_pointer(cnew, o1); + char *p1 = cnew + o1; if ( (cnew == NULL) || (tmp == NULL) ) return; strcpy(tmp, p1); strcpy(p1, t); -- cgit v1.2.3