trstring() has \ooo octal printing code, it's buggy
Denys Vlasenko <[email protected]> Wed, 28 Jan 2026 13:06:52 +0100
| Newsgroups | org.kernel.vger.dash |
|---|---|
| Message-ID | <CAK1hOcMsRRQsgp+pyNmui2v+gMx6zFf6nLa89jzeid-AfcKv8w@mail.gmail.com> |
Good day,
putc('\\', tracefile);
putc(*p >> 6 & 03, tracefile);
putc(*p >> 3 & 07, tracefile);
putc(*p & 07, tracefile);
The last three putc need '0' added to the char value:
they need to print '0...'7' bytes, not 0...7