freebsd-src/usr.bin/diff
John Baldwin 6100374ccf diff: Don't (ab)use sprintf() as a kind of strcat().
Previously print_header() used sprintf() of a buffer to itself as a
kind of string builder but without checking for overflows.  This
raised -Wformat-truncation and -Wrestrict warnings in GCC.  Instead,
just conditionally print the new timestamp fields after the initial
strftime()-formatted string.  While here, use sizeof(buf) with
strftime() rather than a magic number.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D36814
2022-11-15 19:17:36 -08:00
..
tests
diff.1
diff.c
diff.h
diffdir.c
diffreg.c diff: Don't (ab)use sprintf() as a kind of strcat(). 2022-11-15 19:17:36 -08:00
Makefile
pr.c
pr.h
TODO
xmalloc.c
xmalloc.h