Hi Andrew,
On 2016-12-01 22:20:27, Andrew Leary wrote to All:
about: "MakeNL 3.4.6 Release":
MakeNL 3.4.6 has been released and hatched into the COORDUTL fileecho.
I noticed the following in the output.c file:
+ if (RemoveBOM)
+ {
+ templine = linebegin;
+ templine = strstr(linebegin, "\xef\xbb\xbf");
+ if (templine != NULL) /* BOM found on line */
+ {
+ templn2 = templine + 3; /* Move rest of line over BOM */
+ strcpy(templine, templn2);
+ }
+ }
Your using strcpy to copy overlapping strings. The behaviour of strcpy when source and destination overlap is undefined for all definitions of strcpy I know. So it might work, or it might not, for all permutations of compilers, os's and compiler options, that makenl is compiled on.
I suggest:
memmove(templine, templn2, strlen(templn2) + 1);
The same is true for the fts5.c file, with about the same code...
Bye, Wilfred.
--- FMail-W32 1.73.8.50-B20161201
* Origin: Native IPv6 connectable node (2:280/464)