Commit Graph

27 Commits

Author SHA1 Message Date
pfg
b9fbd2df3a ed(1): drop redundant parenthesis.
These were Left-over from the cleanup in r309936.
2016-12-14 21:14:43 +00:00
pfg
b7278ffafc 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
af31e8843c 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
fbb83e78c0 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
brueffer
b95e8ce3cf 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
obrien
c84c569bd1 Consistently use __FBSDID 2002-06-30 05:13:54 +00:00
jmallett
50fc04895e 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
imp
3fc8df52e3 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
ache
df6c6c6c15 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
eced21209c 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
66312e4a8d $Id$ -> $FreeBSD$ 1999-08-27 23:15:48 +00:00
kris
713dd62834 Various spelling/formatting changes.
Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
1999-05-08 10:22:15 +00:00
helbig
ab7e7a033c Ensure stdout is line buffered.
Change "pat" -> "re" in man page.
1997-12-31 12:25:35 +00:00
eivind
d6e21d08f0 Un-clobber mktemp->mkstemp patch. 1997-10-09 11:05:16 +00:00
eivind
b197c558d0 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
792ebc1ba3 sccsid -> rcsid and fix some minor nits. 1997-08-07 21:33:47 +00:00
imp
a1b85d3196 Use mkstemp rather than mktemp to prevent races.
Obtained from: OpenBSD
1997-03-24 05:45:29 +00:00
peter
83b3c2c161 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
jkh
808a36ef65 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
c5d0f9cb39 -Wall cleaning. 1996-12-14 06:08:03 +00:00
rgrimes
1888033949 Remove trailing whitespace.
Reviewed by:	phk
1995-05-30 00:07:29 +00:00
dg
8722740e7f Added $Id$ 1994-09-24 02:59:15 +00:00
alm
be89471c9d use umask 077 for buffer file 1994-03-23 04:36:59 +00:00
alm
26c84d7dc7 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
alm
ffd56febcd Consolidate mark code - no functional changes or fixes. 1993-07-02 06:16:28 +00:00
alm
3ee56e1af8 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
alm
8eb89f7025 POSIX ed version 0.6 by Andrew Moore (alm@netcom.com). 1993-06-18 13:00:14 +00:00