Commit Graph

18 Commits

Author SHA1 Message Date
Ed Schouten
43420d1cad Add missing static keywords to rs(1) 2011-11-06 08:16:35 +00:00
Jaakko Heinonen
96a7586b7d - Use LINE_MAX from limits.h as the maximum line length instead of
BUFSIZ. Use LINE_MAX * 2 as the buffer size (BSIZE).
- Error out if we encounter a line longer than LINE_MAX. The previous
  behavior was to silently split long lines and produce corrupted
  output.

PR:		bin/151384
2011-02-07 18:10:18 +00:00
Jaakko Heinonen
a373cd6a6f Handle EOF when skipping lines. 2011-02-07 18:05:56 +00:00
Joel Dahl
da52b4caaf 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
2010-12-11 08:32:16 +00:00
Colin Percival
5fe69bb518 Setting a variable to the same value twice doesn't actually make it
more likely to have the right value.  Remove superfluous assignments.

Found by:	LLVM/Clang Static Checker
2008-08-04 06:39:52 +00:00
Robert Drehmel
92bc8d4e8e - Set negative row or column argument values to zero.
Negative values would produce undefined behaviour including
   a possible segmentation fault.
 - Explicitly initialize the global row and column variables
   to zero.

PR:		bin/80348
2005-04-28 12:37:15 +00:00
Tim J. Robbins
a2b28f9d9a Avoid passing negative values to isdigit() on machines with signed chars. 2004-07-15 10:26:38 +00:00
Tim J. Robbins
8cd4e21f0f Contrary to what the comments said, rs -H did not recycle storage, it just
kept writing past the end of the buffer. Correct the code so that it
actually does recycle storage.
2002-06-07 07:08:06 +00:00
Mark Murray
791e544b6b Use __FBSDID, ANSIfy functions, fix const string. 2002-04-28 11:00:34 +00:00
Warner Losh
d3cb5ded92 remove __P 2002-03-22 01:33:25 +00:00
Ruslan Ermilov
1cdc4a5318 Do not overrun entry array when printing output tables.
Cleanup storage allocation for entries.

Obtained from:	NetBSD
2001-09-10 15:09:12 +00:00
Ruslan Ermilov
db8b9c344e Fixed SIGFPE (divide by zero) if column's width exceeds display width (-w).
Obtained from:	OpenBSD
2001-09-10 11:56:07 +00:00
Ruslan Ermilov
c4c981072b Fixed the -z option handling:
-Wuninitialized if used without -t.

PR:		bin/30467

Null pointer dereference if used with -t.

Maximum column width computation was wrong.
2001-09-10 11:43:40 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
John Birrell
32744e40cd Add #include <string.h> to get prototypes. 1998-02-20 04:48:37 +00:00
Philippe Charnier
e25f6756fb Use err(3). Add usage(). Rewrote man page in mdoc format. 1997-08-07 06:42:37 +00:00
Joerg Wunsch
7439849253 The rs(1) command dumps core with the -s option (SIGSEGV)
(Fix a rangecheck condition.)

Closes PR # bin/1244: rs(1) dumps core with -s
1996-05-26 18:26:55 +00:00
Rodney W. Grimes
9b50d90275 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00