On Wednesday, 3 January 2024 02:48:26 -03 James Tirta Halim wrote:
> - u = xstrdup(src);
> - for (i = 0; u[i]; i++)
> - u[i] = toupper(u[i]);
> - u[i] = '\0';
> + dst = u = fail_on_null(malloc(strlen(src) + 1));
This does have the advantage of not writing to
I personally find the current code more readable.
uppercase_dup() was copying SRC to DST and converting DST to uppercase. Now it
converts to uppercase while copying.
find_enumeration() was calling strlen() on the whole string before checking for
the '.'
character in a loop. Now it uses strchr().
---
src/scanner.c | 19 +++
1