|
From: Jun. T <tak...@kb...> - 2022-12-15 16:16:12
|
'make html' fails on one of my Mac (intel CPU, macOS Mojave, a rather
old version). The problem is in docs/doc2web.c:
507 } else {
508 /* close current file and start a new one */
509 char newfile[PATH_MAX] = "";
510
511 end_of_titlepage:
(snip)
531 /* open new file */
532 strcat(newfile,path);
533 strncat(newfile,location,PATH_MAX-strlen(newfile)-6);
If we jump into this block by 'goto end_of_titlepage', then newfile[0] is
not initialized to '\0', and the strcat() at line 532 does not work as expected.
This does not happen on other Macs or on Linux, but I guess C language standard
does not guarantee that newfile is initialized after goto.
We can simply fix this by replacing strcat() at line 532 by
strcpy(newfile, path);
(and the initializer = "" at the end of line 509 is redundant)
|