20 Mar
2023
20 Mar
'23
6:21 p.m.
I just noticed this, but:
```diff +static void read_int(const char **line, int *i) +{ + char *rest; + long val; + + errno = 0; + val = strtol(*line, &rest, 0); + + if (errno != 0) + fatal_error("Malformed int constant '%s'.\n", *line); + + *i = val; + if (*i != val) + fatal_error("Out of range int constant '%s'.\n", *line); ```
Here and to some extent above, I don't think we can just print "*line"; there may be additional data beyond "rest" that we'd also output. We may also want to make sure "*rest" is either '\0' or a whitespace character. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/129#note_27329