diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-03-03 17:52:22 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-03-03 17:52:22 -0500 |
| commit | 07f0a18136a7883d1f3edd3e08253bd3020294a8 (patch) | |
| tree | 940ef3ecc108bf8fa37f811f8ca9887efb201d22 /parse.c | |
| parent | 0fe255a7c1ea7f8c324bfa58cdfb2c77f06bd823 (diff) | |
Fix endptr stuff in parser
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |
