aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/qreg-commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/qreg-commands.c')
-rw-r--r--src/qreg-commands.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qreg-commands.c b/src/qreg-commands.c
index 089f2a5..d7bfafe 100644
--- a/src/qreg-commands.c
+++ b/src/qreg-commands.c
@@ -374,7 +374,8 @@ teco_state_setqregstring_nobuilding_done(teco_machine_main_t *ctx,
gsize len = 0;
if (qreg->vtable->get_codepage(qreg) == SC_CP_UTF8) {
- buffer = g_malloc(6*args);
+ /* the glib docs wrongly claim that one character can take 6 bytes */
+ buffer = g_malloc(4*args);
for (gint i = args; i > 0; i--) {
teco_int_t v;
if (!teco_expressions_pop_num_calc(&v, 0, error))