aboutsummaryrefslogtreecommitdiff
path: root/src/sc_parse.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2016-03-29 22:56:07 +0200
committerThomas White <taw@bitwiz.org.uk>2016-03-29 22:56:07 +0200
commitc56a39fc9bda020f6c5c862bcf7c9455e0d83459 (patch)
treef830f6bbe42708e7fa2f4383371830c0951488d7 /src/sc_parse.c
parentd7ee6bba4f775abb09836cddf1dd6a7cda5f04db (diff)
Enable text insertion
Diffstat (limited to 'src/sc_parse.c')
-rw-r--r--src/sc_parse.c4
1 files changed, 2 insertions, 2 deletions
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);