aboutsummaryrefslogtreecommitdiff
path: root/builtins
diff options
context:
space:
mode:
Diffstat (limited to 'builtins')
-rw-r--r--builtins/text.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtins/text.c b/builtins/text.c
index c4514892..66622f5f 100644
--- a/builtins/text.c
+++ b/builtins/text.c
@@ -1573,12 +1573,14 @@ public array_t Text$codepoint_names(Text_t text)
for (int64_t c = 0; c < synthetic_graphemes[-grapheme-1].num_codepoints; c++) {
char *name = GC_MALLOC_ATOMIC(UNINAME_MAX);
name = unicode_character_name(synthetic_graphemes[-grapheme-1].codepoints[c], name);
+ if (!name) name = "???";
Text_t name_text = (Text_t){.tag=TEXT_ASCII, .length=strlen(name), .ascii=name};
Array$insert(&names, &name_text, I_small(0), sizeof(Text_t));
}
} else {
char *name = GC_MALLOC_ATOMIC(UNINAME_MAX);
name = unicode_character_name(grapheme, name);
+ if (!name) name = "???";
Text_t name_text = (Text_t){.tag=TEXT_ASCII, .length=strlen(name), .ascii=name};
Array$insert(&names, &name_text, I_small(0), sizeof(Text_t));
}