[luatex] A bug in show_context second line indentation

luigi scarso luigi.scarso at gmail.com
Fri Oct 18 13:48:06 CEST 2024


On Fri, 18 Oct 2024 at 12:06, Hartmut Henkel via luatex <luatex at tug.org>
wrote:

> Hi Luigi,
>
> On Fri, 18 Oct 2024, luigi scarso wrote:
> > On Thu, 17 Oct 2024 at 18:06, user202729--- via luatex <luatex at tug.org>
> wrote:
> >       b/source/texk/web2c/luatexdir/tex/printing.c
> >       index 8a52700..8ae11b4 100644
> >       --- a/source/texk/web2c/luatexdir/tex/printing.c
> >       +++ b/source/texk/web2c/luatexdir/tex/printing.c
> >       @@ -482,7 +482,8 @@ void tprint(const char *sss)
> >            }
> >            /*tex What is left is the 3 term/log settings. */
> >            if (dolog || doterm) {
> >       -        buffer = xmalloc(strlen(sss)*3);
> >       +        size_t len = strlen(sss);
> >       +        buffer = xmalloc(len*3);
>
> only looking here by accident, but google tells that UTF-8 is 1 to 4
> bytes. So is "len*3" safe?
>

Indeed this is (one of the) issue(s) because that part is a mix of the
traditional no-UNICODE  (pdf)TeX  and luatex, that manages UTF-8.
The |pseudo| buffer for |show_contex| is a bit complicated.

--
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/luatex/attachments/20241018/45c82f3e/attachment.htm>


More information about the luatex mailing list.