Re: [PATCH] scanner.c: prefer strchr() over for loop and toupper() in place

2024-01-09 Thread Thiago Macieira
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 e

Re: [PATCH] scanner.c: prefer strchr() over for loop and toupper() in place

2024-01-06 Thread Simon Ser
I personally find the current code more readable.