History log of /freebsd-10.3-release/usr.bin/hexdump/display.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 296373 04-Mar-2016 marius

- Copy stable/10@296371 to releng/10.3 in preparation for 10.3-RC1
builds.
- Update newvers.sh to reflect RC1.
- Update __FreeBSD_version to reflect 10.3.
- Update default pkg(8) configuration to use the quarterly branch.

Approved by: re (implicit)

# 282738 10-May-2015 jilles

MFC r282041: hexdump: Don't use uninitialized struct stat.

PR: 196194


# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 229403 03-Jan-2012 ed

Replace index() and rindex() calls with strchr() and strrchr().

The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.


# 216370 11-Dec-2010 joel

Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with: imp, rwatson


# 200462 13-Dec-2009 delphij

Revert most part of 200420 as requested, as more review and polish is
needed.


# 200420 11-Dec-2009 delphij

Remove unneeded header includes from usr.bin/ except contributed code.

Tested with: make universe


# 133099 04-Aug-2004 tjr

In next(), ensure that 'done' is set in the case when a file cannot
be opened, to avoid trying to read standard input after already closing
it, which resulted in EBADF errors.


# 132785 28-Jul-2004 kan

Do not predeclare __inline functions, this makes no sense and generates
a warning with gcc 3.4.x.


# 132541 22-Jul-2004 johan

display.c:
- 'savech' is only used if it is set a few lines above where
it is used, initialize it to silence warning.

- 'length' is either -1 or greater than 0, hence it is safe to cast it
to unsigned when comparing it here.

odsyntax.c:
- 'p' is assigned either (*argvp)[0] or (*argvp)[1] which both are
char *. 'num' and 'end' are assigned values based on 'p'.
Hence use char * instead of unsigned char * for these variables.

'&end' as the second argument to strtoll does not need to be casted
to char** any more.

This solves a
'dereferencing type-punned pointer will break strict-aliasing rules'
warning when compiling with -O2.

parse.c:
- 'prec' is only used when sokay == USEPREC and sokay = USEPREC
when 'prec' is assigned. Hence 'prec' is not used uninitialized,
initialize it to silence warning.

- The code involving 'nextpr' is hard to follow, but I belive
'nextpr' will not be used unless it is initialized.
Anyway, IF 'nextpr' is used uninitialized it is better to
get a consistant error (seg fault, when dereferencing a NULL pointer)
than potentially accessing some random memory.

The above changes makes hexdump WARNS=6 clean even when compiled with
-O2. Hence bump WARNS to keep it clean.

Tested by: CFLAGS='-O2 -pipe' make universe


# 131954 11-Jul-2004 tjr

Add POSIX-style support for multibyte characters to od(1): the 'c'
conversion interprets input bytes as multibyte sequences and displays
printable characters in the area corresponding to their first byte.
The remaining bytes are shown as "**".


# 102944 04-Sep-2002 dwmalone

ANSIify function definitions.
Add some constness to avoid some warnings.
Remove use register keyword.
Deal with missing/unneeded extern/prototypes.
Some minor type changes/casts to avoid warnings.

Reviewed by: md5


# 100359 19-Jul-2002 markm

s/inline/__inline/


# 99112 30-Jun-2002 obrien

Consistently use FBSDID


# 96795 17-May-2002 tjr

Overhaul hexdump's od syntax code to handle the -s -A -j -N -t options that
SUSv3 requires and give od a proper manual page.

PR: 36783


# 96793 17-May-2002 tjr

Declare variables that were extern'd in multiple places in hexdump.h.

PR: 36783


# 96792 17-May-2002 tjr

Add support for printing long doubles.

PR: 36783


# 96790 17-May-2002 tjr

Print signed single-byte decimal integers correctly instead of implicitly
converting them to unsigned bytes.

PR: 36783


# 92920 22-Mar-2002 imp

remove __P


# 91838 07-Mar-2002 obrien

Slightly more efficient fix to the const problem.


# 87203 02-Dec-2001 markm

WARNS=2 fixups.


# 82766 01-Sep-2001 ache

File positions are off_t nowdays, not long, so:
strtol -> strtoll
fseek -> fseeko

NOTE: that fseek not works for >long offsets files per POSIX:

[EOVERFLOW] For fseek( ), the resulting file offset would be a value which
cannot be represented correctly in an object of type long.


# 80290 24-Jul-2001 obrien

Remove the misnamed `emalloc' and replace its uses with the calloc (along
with error checking) that it actually was.


# 62893 10-Jul-2000 kris

Oops, missed another printf() invocation with no format string.


# 62892 10-Jul-2000 kris

Don't call printf() with no format string.


# 50477 28-Aug-1999 peter

$Id$ -> $FreeBSD$


# 41724 13-Dec-1998 dillon

PR: bin/9016

Fix bug with od/hd/hexdump. "*" lines are supposed to indicate one or
duplicates of the previous line, but a small file with less then 16
characters of zeros in it will be falsy identified as a repeat of
the (non-existant) previous line. i.e. the first line of output winds
up being a "*". Added a bit of code to handle the degenerate 'there is
no previous line' case for the first line.


# 27315 10-Jul-1997 charnier

Use err(3) instead of local redefinition, incorporate `hd' in usage str.


# 1591 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1590,
which included commits to RCS files with non-trunk default branches.


# 1590 27-May-1994 rgrimes

BSD 4.4 Lite Usr.bin Sources