Skip to content

Commit 9172079

Browse files
committed
fixed char_code for unicode
1 parent 7d5ebad commit 9172079

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

builtin.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3157,7 +3157,7 @@ int b_atom_string(int arglist, int rest, int th)
31573157
int b_char_code(int arglist, int rest, int th)
31583158
{
31593159
int n, ind, arg1, arg2, code, res;
3160-
char str[2];
3160+
char str[16];
31613161

31623162
n = length(arglist);
31633163
ind = makeind("char_code", n, th);
@@ -3194,7 +3194,7 @@ int b_char_code(int arglist, int rest, int th)
31943194
exception(ILLEGAL_ARGS, ind, arg1, th);
31953195
}
31963196
//unicode
3197-
code = makeint(utf8_to_ucs4(GET_NAME(arg1)));
3197+
code = makeint(utf8_to_ucs4(str));
31983198
res = unify(arg2, code, th);
31993199
if (res == YES)
32003200
return (prove_all(rest, sp[th], th));

0 commit comments

Comments
 (0)