freebsd-src/usr.bin/hexdump
Xin LI 1232c7884d od(1): Fix skip value handling
POSIX defines -j as the number of bytes that od(1) should skip over the
concatenated input files. The existing code tries to implement this behavior
by checking if the current address was smaller than the skip value. However,
this is not correct, because we adjust both the skip value and the address
at the same time when we do fseeko (when file is seekable) or getchar (when
file is not seekable).

This commit fixes the problem by expecting the skip value to be zero upon
return of next(). If the condition is not satisfied, a diagnostic message
will be issued.

Reported-by:	Mohamed Akram <mohd.akram@outlook.com>
Reviewed-by:	emaste
PR:		271832
MFC-after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D40446
2023-06-07 18:06:07 -07:00
..
tests spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
conv.c
display.c od(1): Fix skip value handling 2023-06-07 18:06:07 -07:00
hexdump.1 hexdump(1): Add EXAMPLES section 2020-06-29 15:15:14 +00:00
hexdump.c
hexdump.h
hexsyntax.c
Makefile
Makefile.depend Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
od.1 od(1): Add EXAMPLES section 2020-06-23 07:48:48 +00:00
odsyntax.c
parse.c Enable support for printing 8-byte integers. For some reason, most of the 2023-06-04 19:23:35 -07:00