CVSROOT:        /cvs
Module name:    src
Changes by:     schwa...@cvs.openbsd.org        2020/09/03 14:33:20

Modified files:
        usr.bin/mandoc : roff_term.c 
        regress/usr.bin/mandoc/roff/po: Makefile 
Added files:
        regress/usr.bin/mandoc/roff/po: range.in range.out_ascii 

Log message:
Fix two issues with .po (page offset) formatting:
1. Truncate excessive offsets to a width reasonable in the context
of manual pages instead of printing excessively long lines
and sometimes causing assertion failures;
found in an afl run performed by Jan Schreiber <jes at posteo dot de>.
2. Remember both the requested and the applied page offset; otherwise,
subtracting an excessive width, then adding it again, would end up
with an incorrectly large offset.
While here, simplify the code by reverting the previous offset up front,
and also add some comments to make the general ideas easier to understand.

Reply via email to