aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--parse.c4
-rw-r--r--test/strings.tm2
2 files changed, 3 insertions, 3 deletions
diff --git a/parse.c b/parse.c
index b67ea418..44e3d33e 100644
--- a/parse.c
+++ b/parse.c
@@ -150,12 +150,12 @@ const char *unescape(const char **out) {
*endpos = endptr;
return heap_strn((char*)buf, bufsize);
} else if (escape[1] == 'x' && escape[2] && escape[3]) {
- char *endptr = (char*)&escape[3+1];
+ char *endptr = NULL;
char c = (char)strtol(escape+2, &endptr, 16);
*endpos = escape + 4;
return heap_strn(&c, 1);
} else if ('0' <= escape[1] && escape[1] <= '7' && '0' <= escape[2] && escape[2] <= '7' && '0' <= escape[3] && escape[3] <= '7') {
- char *endptr = (char*)&escape[4];
+ char *endptr = NULL;
char c = (char)strtol(escape+1, &endptr, 8);
*endpos = escape + 4;
return heap_strn(&c, 1);
diff --git a/test/strings.tm b/test/strings.tm
index a7631824..7d54b811 100644
--- a/test/strings.tm
+++ b/test/strings.tm
@@ -6,5 +6,5 @@
>> str:lower():title()
= "Hello Amélie!"
->> \UE9
+>> \U00E9
= "é"