Commit Graph

27 Commits

Author SHA1 Message Date
Pedro F. Giffuni
f50fae318d ed(1): drop redundant parenthesis.
These were Left-over from the cleanup in r309936.
2016-12-14 21:14:43 +00:00
Pedro F. Giffuni
8bd856de21 ed(1): Simplify some checks.
The return type for both fread(3) and fwrite(3) cannot be negative, this
renders some checks invalid and variable 'ct' unnecessary.
Also bump 'len' to size_t to avoid signed/unsigned comparison warnings.
2016-12-12 20:25:59 +00:00
Ed Schouten
bf70becee6 More -Wmissing-variable-declarations fixes.
In addition to adding `static' where possible:

- bin/date: Move `retval' into extern.h to make it visible to date.c.
- bin/ed: Move globally used variables into ed.h.
- sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings.
- usr.bin/calendar: Remove unneeded variables.
- usr.bin/chat: Make `line' local instead of global.
- usr.bin/elfdump: Comment out unneeded function.
- usr.bin/rlogin: Use _Noreturn instead of __dead2.
- usr.bin/tset: Pull `Ospeed' into extern.h.
- usr.sbin/mfiutil: Put global variables in mfiutil.h.
- usr.sbin/pkg: Remove unused `os_corres'.
- usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
2012-10-19 14:49:42 +00:00
Ed Schouten
ae824d80f2 Fix warnings found by -Wmising-variable-declarations.
This self-written compiler warning, which is hopefully going to be
committed into LLVM sources soon, warns about potentially missing
`static' keywords, similar to -Wmissing-prototypes.

- bin/pax: Move external declaration of chdname and s_mask into extern.h.
- bin/setfacl: Move setfacl.c-specific stuff out of setfacl.h.
- sbin/mount_fusefs: Remove char *progname; use getprogname().
- others: add `static' where possible.
2012-10-19 05:43:38 +00:00
Christian Brueffer
ae568477e7 Fix memory leaks in error cases.
PR:		159011
Submitted by:	Henning Petersen <henning.petersen@t-online.de>
Approved by:	re (kib)
MFC after:	1 week
2011-08-27 15:28:57 +00:00
David E. O'Brien
5eb43ac2f7 Consistently use __FBSDID 2002-06-30 05:13:54 +00:00
Juli Mallett
49d54362f1 Bogusness may have happened using a variable assignment here before, but
proper parens mean that fd is always set by open(2) [in any part of C],
and so we can accurately check for it returning -1, without feeling like
we need to initialise fd to -1 in its declaration.

In other words, fix a stylistic/bogus nit.
2002-06-20 07:15:55 +00:00
Warner Losh
7669d0fc4f 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.
o gc some #ifdef sun ... #endif code

Approved by: arch@, new style(9)
2002-02-02 06:36:49 +00:00
Andrey A. Chernov
7cbfe4d8da File positions are off_t nowdays, not long, so:
fseek -> fseeko
  ftell -> ftello

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

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

  [EOVERFLOW] For ftell ( ), the current file offset cannot be represented
  correctly in an object of type long.
2001-09-01 23:26:40 +00:00
Mike Barcroft
a4616748ab o Correctly define rcsid.
o Add consts where appropriate.
o Rename some variables that were shadowing global declarations.
o Remove register storage-classes.
o Make errmsg a const, so we can just set error messages instead
  of using sprintf/strcpy.
o Set WARNS=2

Reviewed by:	bde, des
2001-08-06 22:01:31 +00:00
Peter Wemm
2a4562393f $Id$ -> $FreeBSD$ 1999-08-27 23:15:48 +00:00
Kris Kennaway
46be34b902 Various spelling/formatting changes.
Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
1999-05-08 10:22:15 +00:00
Wolfgang Helbig
fd0e1c252b Ensure stdout is line buffered.
Change "pat" -> "re" in man page.
1997-12-31 12:25:35 +00:00
Eivind Eklund
f8ce2ec95f Un-clobber mktemp->mkstemp patch. 1997-10-09 11:05:16 +00:00
Eivind Eklund
af6ab81d43 mktemp -> mkstemp
Obtained from: OpenBSD (file rev 1.4 by Theo de Raadt <deraadt@openbsd.org>)
1997-10-08 13:46:39 +00:00
Steve Price
5967604a1e sccsid -> rcsid and fix some minor nits. 1997-08-07 21:33:47 +00:00
Warner Losh
e38b50134c Use mkstemp rather than mktemp to prevent races.
Obtained from: OpenBSD
1997-03-24 05:45:29 +00:00
Peter Wemm
b97fa2ef50 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Steve Price
78b09ffeaf -Wall cleaning. 1996-12-14 06:08:03 +00:00
Rodney W. Grimes
2162b2d226 Remove trailing whitespace.
Reviewed by:	phk
1995-05-30 00:07:29 +00:00
David Greenman
89730b290a Added $Id$ 1994-09-24 02:59:15 +00:00
Andrew Moore
d165d4acee use umask 077 for buffer file 1994-03-23 04:36:59 +00:00
Andrew Moore
95e6217e73 Fixed range address bug: 1,2, == 2,2 not 2,.
Overhauled the name space,  reworked some modules and removed the
obsolescent Addison-Wesley copyright.
1994-02-01 00:36:28 +00:00
Andrew Moore
95c745afb2 Consolidate mark code - no functional changes or fixes. 1993-07-02 06:16:28 +00:00
Andrew Moore
10ca1c6c92 fixed undo within a global command (would corrupt the buffer)
changed move within a global to behave as in SunOS
added a couple error messages
1993-06-26 06:47:21 +00:00
Andrew Moore
30154ac8a8 POSIX ed version 0.6 by Andrew Moore (alm@netcom.com). 1993-06-18 13:00:14 +00:00