Commit Graph

84 Commits

Author SHA1 Message Date
cperciva
2a9e62dd03 Fix memory leak
PR:		bin/64321
Submitted by:	Rodney Ruddock <rodney@interopsystems.com>
MFOpenBSD:	rev 1.17
MFC after:	3 days
2004-03-16 08:33:33 +00:00
markm
f1849df8d1 Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror)
that this provokes. "Wherever possible" means "In the kernel OR NOT
C++" (implying C).

There are places where (void *) pointers are not valid, such as for
function pointers, but in the special case of (void *)0, agreement
settles on it being OK.

Most of the fixes were NULL where an integer zero was needed; many
of the fixes were NULL where ascii <nul> ('\0') was needed, and a
few were just "other".

Tested on: i386 sparc64
2004-03-05 08:10:19 +00:00
markm
2f11ff8443 Get this area compiling with the highest WARNS= that it works with.
Obsolete WFORMAT= junk also removed where possible.

OK'ed by:	obrien
Tested on:	sparc64, alpha, i386
2003-06-13 07:04:02 +00:00
markm
95b3ea00cd Fix a bazillion warnings. This makes almost the whole of src/bin/*
WARNS=6, std=c99 clean.

Tested on:	i386, alpha
2003-05-03 16:39:34 +00:00
obrien
d6c4a41766 Quiet warnings about copyright[]. 2003-05-02 00:04:21 +00:00
obrien
5b7a13d7e8 Fix signed/unsigned mix comparisons involving sizeof. 2003-05-02 00:03:10 +00:00
tjr
cc00a6f834 Add the -j and -y options to the synopsis. 2003-05-01 02:37:46 +00:00
obrien
c7d94fe8f3 Make the "tarcp" example more direct. 2003-01-10 17:37:23 +00:00
schweikh
c353aec149 Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
tjr
8abcb1658d Ensure all va_starts have a matching va_end.
Obtained from:	NetBSD
2002-10-06 09:23:58 +00:00
tjr
c933bf0527 /dev/sa0 is the default tape device, not /dev/rst0. 2002-10-06 07:56:27 +00:00
tjr
631ef206d0 Fix format string errors relating mainly to the use of %qu to print off_t's.
Instead use %ju and cast the argument.

WFORMAT=0 is still required in the Makefile because gcc warns about
some strftime() calls (I don't think this behaviour is useful.)

Tested on:	sparc64, alpha, i386
2002-10-06 03:20:27 +00:00
bde
3d187a3e1b Removed extra $FreeBSD$. Moved #if 0 for the vendor id to the correct
place.  Restored indent protection of copyright comment.
2002-08-22 01:07:16 +00:00
trhodes
76af16d03e s/filesystem/file system/ as discussed on -developers 2002-08-21 17:32:44 +00:00
keramida
d5bcab9863 Fix a couple of typos in a comment.
PR:		docs/33559
Submitted by:	Marc Olzheim <marcolz@ilse.nl>
2002-07-15 02:03:30 +00:00
obrien
3ba7184ea6 Consistently use FBSDID 2002-06-30 05:15:05 +00:00
trhodes
dd60aff5bb more file system > filesystem 2002-05-16 03:51:38 +00:00
trhodes
c496773415 Consistancy check s/file system/filesystem/
Reviewed by:	brian
2002-05-16 01:57:20 +00:00
charnier
fa12f7cfce Use `The .Nm utility' 2002-04-21 12:53:08 +00:00
charnier
9aa77c9a51 Use `The .Nm utility' 2002-04-20 11:58:12 +00:00
charnier
5ecd7aba7b Do not return(f_returning_void());. Spell FALLTHROUGH to make it lint()able. 2002-04-12 20:23:51 +00:00
markm
ec1eb74186 No need to cast; ().gr_gid is already the correct type. 2002-03-22 15:54:44 +00:00
kris
a70c59cd2b Correct inadvertent style botches in previous commit. 2002-02-04 03:06:51 +00:00
kris
5e9114e650 Lock down with WFORMAT=1 except those directories with unfixed warnings.
Tested on i386 and alpha.
2002-02-04 02:49:19 +00:00
imp
af825eb88c Ooops, forgot to remove the registers here. 2002-02-02 07:07:59 +00:00
imp
14c2daab0f o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
  they already are.
2002-02-02 06:48:10 +00:00
obrien
3e1e2dd6aa Default to WARNS=2. Binary builds that cannot handle this must explicitly
set WARNS=0.

Reviewed by:	mike
2001-12-04 01:57:47 +00:00
dillon
9ea9c71b6d Use a quad int conversion routine for time_t instead of ulong, capable of
decoding tar's full time buffer (12 digits).
2001-10-28 02:51:43 +00:00
dillon
b9108e6fb0 Various string fields for certain cpio types are 11 rather then 8
characters.  Use quad conversion functions rather then long conversion
where appropriate to handle the available range.  Mainly fixes time_t
but there was also a st_size ulong conversion in there that has to be
quad or cpio cannot be used to copy files > 2G.

MFC after:	1 day
2001-10-28 02:45:04 +00:00
dillon
60f99f0460 Remove unnecessary casts in timeval.tv_sec load from st_*time 2001-10-28 02:42:26 +00:00
ru
173222b339 mdoc(7) police: s/BSD/.Bx/ where appropriate. 2001-08-14 10:01:54 +00:00
peter
e03826091d Initialize listf at main() 2001-08-13 21:54:47 +00:00
ru
3b72217422 mdoc(7) police: join split punctuation to macro calls. 2001-08-10 17:35:21 +00:00
dd
c49a4e6620 Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
ru
0a93ab6251 mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 10:04:09 +00:00
dd
978810079e mdoc(7) police: remove extraneous .Pp before and/or after .Sh. 2001-07-09 09:54:33 +00:00
brian
34ad3e29c4 Fix the type of the NULL arg to execl()
Idea from: Theo de Raadt <deraadt@openbsd.org>
2001-07-09 09:24:06 +00:00
dd
f5d286af56 Include missing header files which define functions for which gcc has
builtins (e.g., exit, strcmp).
2001-06-24 23:04:23 +00:00
imp
d3629bff4b Minor comment fix 2001-05-30 03:25:45 +00:00
ru
6a2327d2d9 mdoc(7) police: fix markup, rename and reorder some sections. 2001-05-08 08:12:53 +00:00
ru
66e5326696 mdoc(7) police: sort xrefs. 2001-05-08 07:19:19 +00:00
kris
f0f4a97cc6 Sync up with OpenBSD. Too many changes to note, but the major features
are:
* Implement cpio compatibility mode when pax is invoked as cpio
* Extend tar compatibility mode to cover many of the GNU tar single-letter
  options (bzip2 mode, aka -y/-j is not present in OpenBSD).  When
  invoked as tar, pax is now full-featured enough for use by the ports
  collection to extract distfiles and create packages.
* Many bug fixes to the operation of pax and the tar compatibility modes
* Code fixes for things like correct string buffer termination.

I tried to preserve existing FreeBSD fixes to this utility; please let me
know if I have inadvertently spammed something.
2001-05-08 06:19:06 +00:00
kris
9eb581c05b Add -z flag to pax to allow gzipping of archive output. Add -z and -Z (gzip
and compress) to pax when used in tar mode (invoked as 'tar') for
compatibility with GNU tar.

bzip2 functionality for further GNU tar compatibility will be added at a
later date.

Note in the manpage that -z is non-standard.

Obtained from:	OpenBSD
Reviewed by:	-hackers
MFC after:	2 weeks
2001-05-05 01:10:13 +00:00
kris
c0458b5dd9 Whitespace cleanup pass; reduce diffs with OpenBSD. No functional changes. 2001-04-26 09:22:28 +00:00
kris
d6b761d326 Reduce diffs with OpenBSD:
#if __STDC__ -> #ifdef __STDC__
  pax_warn() -> paxwarn()
  sys_warn() -> syswarn()
  (foo *)NULL -> NULL
  bcopy -> memmove()/memcpy()
  bzero -> memset()
  Typo fixes
  sprintf() -> snprintf()
  rindex() -> strrchr()
  index() -> strchr()
  sys_errlist[] -> strerror()

Obtained from:	OpenBSD
2001-04-26 08:37:00 +00:00
kris
9b6fb2f5f9 Use mkstemp() for secure tempfile creation instead of tempnam()
Obtained from:	OpenBSD
Reviewed by:	mikeh
2001-04-26 07:32:27 +00:00
kris
61a429452c -Wnon-const-format sweep: make format strings const char *'s, add
__printflike()/__printf0like() to function prototypes, as appropriate.

Reviewed by:	bde, -audit
2001-04-17 07:46:38 +00:00
ache
f19ded5c99 Use nl_langinfo instead of %Ef 2001-03-21 13:33:09 +00:00
ru
23aab9f696 POSIX wrote:
: LC_TIME   This variable shall determine the format and
:           contents of date and time strings when the -v
:           option is specified.

Developers took this wrong.  LC_TIME specifies the locale
name, not the ``format'' argument of strftime().

Oops:
	pax -w -f /tmp/foo /dev/null
	LC_TIME=de_DE.ISO_8859-1 pax -v -f /tmp/foo
2001-03-02 16:19:49 +00:00
ru
128310ec7a mdoc(7) police: use the default ``file ...'' feature of the .Ar macro. 2001-02-13 09:56:35 +00:00