Commit Graph

13947 Commits

Author SHA1 Message Date
mrg
4df8bc966e sprintf() -> snprintf(), and adjust a buffer size to avoid any
potential for overflow.
2019-10-06 00:27:50 +00:00
mrg
cfe79b5b48 use memcpy() for strings that are not C strings.
destinations are already sufficiently sized and nul terminated.
2019-10-05 23:35:57 +00:00
christos
bdf26a6120 Recognize \oOOO \dDD \xXX plus the other regular 'C' backslash escapes like
gnu sed does, except when inside regex []. (Gnu sed translates those too,
unless --posix is specified).
2019-10-05 20:23:55 +00:00
christos
3379dd2438 add an abort for a case that can't happen 2019-10-05 20:22:36 +00:00
mrg
03c86659de fix a bug gcc 8 picked up: use ~LOCK_NB to look for LOCK_UN,
like the rest of the code does.

from uwe@.
2019-10-04 16:27:00 +00:00
uwe
5e58365557 Undo the confusion. Use separate synopsis lines for -c command with
single argument (sh -c) and command [args ...] forms.
2019-10-04 16:14:05 +00:00
uwe
371c573fa8 The command is not optional. 2019-10-04 15:30:16 +00:00
uwe
612f4075e0 Tweak formatting. 2019-10-04 11:49:48 +00:00
mrg
0576183ec8 revert previous; i meant to test first and if you read the comment
immediately above, you can see it is done safely and on purpose.
2019-10-04 11:43:07 +00:00
mrg
f97b85d675 use destination buffer size not source buffer size for strncpy len. 2019-10-04 11:40:43 +00:00
mrg
0af6a5291a use memmove() instead of strncpy() for overlapping strings.
ensure nul termination.
2019-10-04 11:39:44 +00:00
mrg
80df6cf66d adjust fallthru comment. 2019-10-04 11:12:16 +00:00
mrg
628b66af12 turn off various warnings for various things:
- file has looks bogus maybe-uninitialized
- llvm triggers an attribute violation:
  ScheduleDAGInstrs.cpp:1430:14: error: declaration of
    'llvm::raw_ostream& llvm::operator<<(llvm::raw_ostream&, const llvm::ILPValue&)'
    with attribute 'noinline' follows inline declaration [-Werror=attributes]
- ntp and pkg_install have obvious restrict violations, should be
  fixed but i'm avoiding patching upstream code in this pass
- tftp has an array bounds that doesn't seem real issue
- sysinst's partman.c has major problem with passing the same
  string as source and dest in snprintf, as a way to strcat
  with formatting which trip restrict violations.  non trivial
  to fix so for now the warning is elided.
- Xext's XEVI.c has similar issue as partman.c

everyone and GCC 8 gets these warnings turned off for now:

	-Wno-format-truncation
	-Wno-stringop-overflow
	-Wno-stringop-truncation
	-Wno-cast-function-type

as they trip a large amount of code.  most of them should be
investigated, but the few i looked at were not finding actually
real bugs, vs instances of poor coding, so skipping for now.
2019-10-04 09:47:27 +00:00
mrg
a83f6c1317 msg:
avoid passing the same pointer in multiple arguments for restrict
marked arguments:
- sigaction() wants separate in/out
- use memmove() not memcpy() for overlapping regions (this may fix
  a real bug in nvi -- but it seems unlikely)
- select() wants separate read/write/except
- sigprocmask() wants separate set/oset
2019-10-04 09:01:59 +00:00
sevan
df68535e27 Skip options which rely on crypto support in getopt() argument list, if we're
not building with cryto support.

via JP <rlntlss83 at gmail com> on tech-misc@
2019-10-03 01:15:19 +00:00
sevan
39ad3db35e Add Alan Perlis 2019-10-01 17:58:25 +00:00
mrg
21303c93e9 convert HAVE_GCC == 7 to HAVE_GCC >= 7. 2019-09-29 23:44:58 +00:00
sjg
7d130808c7 Do not assume safe to pass NULL to realpath(3).
PR: 54574
Reviewed by: buhrow
2019-09-26 21:09:55 +00:00
christos
02cdd248ec Add a new member to struct vfsstat and grow the unused members
The new member is caled f_mntfromlabel and it is the dkw_wname
of the corresponding wedge. This is now used by df -W to display
the mountpoint name as NAME=
2019-09-22 22:59:37 +00:00
dsainty
8c74e515a9 Purge an ancient email address, use dsainty@NetBSD.org instead 2019-09-22 07:28:35 +00:00
sevan
0ed1b2a1a6 We use spaces, not tabs here 2019-09-21 09:23:11 +00:00
sevan
88d1988908 sort 2019-09-21 09:15:24 +00:00
sevan
eaa5be79ae Add 8.1 release 2019-09-21 09:13:10 +00:00
dyoung
edd6d16024 Deduplicate some code I'd duplicated, shorten a couple of staircases,
repair the indentation in usage().  NFCI.
2019-09-13 17:32:29 +00:00
dyoung
733dd361b1 Fix unexpand -a -t n, which also did not treat -t n like it
established stops n, 2 n, 3 n, ....
2019-09-13 17:26:27 +00:00
dyoung
5487d3395a Fix a handful of bugs in unexpand(1):
1. -a and -t were mutually exclusive when they should not be.

2. `unexpand -t n` did not treat a file like there were stops at n, 2
   n, 3 n, 4 n, and so on.  So expanded tabs after column 4 were not
   collapsed.

3. a debug fprintf wrote every tabstop set with `-t` to the standard
   error stream.

TBD write some tests.
2019-09-13 16:53:05 +00:00
christos
d275294e40 Expose struct namecache. 2019-09-13 13:56:04 +00:00
christos
c2ff892ce4 deal with variable length namecache entries. 2019-09-13 13:55:24 +00:00
wiz
2555b24764 Use \(em. 2019-09-06 19:05:04 +00:00
christos
ebe962e4c8 Add -O to print offsets; align columns properly. 2019-09-06 17:08:22 +00:00
christos
3876b93077 Fix decorators for __thread, add _Thread_local
christos
2019-09-05 20:12:11 +00:00
wiz
f592f951d4 Remove superfluous Ns. 2019-09-01 19:12:16 +00:00
wiz
3e49c49077 Remove superfluous Pp. 2019-09-01 19:10:39 +00:00
sevan
6eaac38858 write was in v1
https://www.bell-labs.com/usr/dmr/www/man14.pdf
2019-09-01 18:48:01 +00:00
sevan
9e5ce6cda6 Update URL 2019-09-01 18:46:22 +00:00
sevan
ddac411ea4 Document history
https://www.bell-labs.com/usr/dmr/www/man14.pdf
2019-09-01 18:44:06 +00:00
sevan
17e867a69e Document history
https://www.bell-labs.com/usr/dmr/www/man13.pdf
2019-09-01 18:41:14 +00:00
sevan
a4ee5060f0 su was in v1
https://www.bell-labs.com/usr/dmr/www/man13.pdf
2019-09-01 18:37:44 +00:00
sevan
450d651e78 Document history
https://www.bell-labs.com/usr/dmr/www/man13.pdf
2019-09-01 18:31:37 +00:00
sevan
a77b177db2 mesg was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf
2019-09-01 18:26:01 +00:00
sevan
822dbc9721 mail was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf
2019-09-01 18:24:28 +00:00
sevan
01835ef10c du was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf
2019-09-01 18:18:42 +00:00
sevan
84c091c750 dc was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf
2019-09-01 18:15:57 +00:00
sevan
b80ec07d43 sort was there since v1
https://www.bell-labs.com/usr/dmr/www/man61.pdf
2019-09-01 18:04:54 +00:00
isaki
3dbad28612 Revert about index number changes. It breaks its usage and output format.
Pointed out by mrg@.
2019-08-24 07:39:42 +00:00
isaki
52ec5b0764 Create a waveform in hardware native sample rate which is more efficient. 2019-08-24 06:32:25 +00:00
isaki
0c69e485a6 AUDIO_GETBUFINFO is more efficient for this purpose. 2019-08-24 06:16:27 +00:00
isaki
04ea388fd4 Fix markup. index of list command is optional. 2019-08-24 06:13:01 +00:00
isaki
8452326aba Make the same code that appears repeatedly a function. 2019-08-24 06:11:10 +00:00
isaki
16e140802c Use err(3)/warn(3) instead of perror(3)/fprintf(stderr,...).
Use getprogname(3) for usage().
2019-08-24 06:00:49 +00:00