Hi, On Sat, Feb 10, 2024 at 11:57:38PM +0100, Elie Le Vaillant wrote: > @@ -399,10 +400,17 @@ sanitize(struct header *h) > for (i = 0; i < LEN(fields); i++) > - for (j = 0; j < fields[i].l; j++) > + for (leading = 1, j = 0; j < fields[i].l; j++) > if (fields[i].f[j] == ' ') > - fields[i].f[j] = '\0'; > + fields[i].f[j] = leading ? '0' : '\0'; > + else > + leading = 0; > }
What do you think if we move this loop into a function and we use it in both cases? Roberto Vargas