aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/qreg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/qreg.c')
-rw-r--r--src/qreg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qreg.c b/src/qreg.c
index 91ee630..271e7cb 100644
--- a/src/qreg.c
+++ b/src/qreg.c
@@ -539,7 +539,7 @@ teco_qreg_external_get_character(teco_qreg_t *qreg, teco_int_t position,
* The sign bit in UCS-4/UTF-32 is unused, so this will even
* suffice if TECO_INTEGER == 32.
*/
- *chr = (gint32)g_utf8_get_char_validated(p, -1);
+ *chr = *p ? (gint32)g_utf8_get_char_validated(p, -1) : 0;
return TRUE;
}