| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
warning.
PR: ports/172566
Submitted by: Erik Cederstrand <erik@cederstrand.dk>
Approved by: cperciva
MFC after: 3 days
|
|
|
|
| |
Found by: clang static analyzer
|
|
|
|
|
|
|
|
| |
1) Split too long source lines
2) Portable code should not assume that null pointer == all-bits-0,
so back out prev. calloc() change.
Submitted by: bde
|
|
|
|
|
|
| |
1) Rename RANDOM_MAX to RANDOM_MAX_PLUS1 to not confuse with random()'s max
2) Use calloc() instead of zeroing fields explicitly
3) "too many lines" -> "too many delimiters" for err()
|
|
|
|
|
|
|
|
|
|
| |
Test case:
random -f some_small_file 10000
(in most cases must be no output)
2) Prevent number of lines > RANDOM_MAX (overflow or nothing may be
choosed) with EFBIG err()
3) After line is found, terminate list loop for -U case too,
since nothing to do in the rest of the loop left.
|
|
|
|
|
|
|
|
|
|
| |
used in randomize_fd.c.
Although the max value is the same currently, RAND_MAX is for rand(),
not for random().
So move RANDOM_MAX const to the common file now, make it UL and
use in randomize_fd.c too.
(in any case its old value was 1 less then must be, as noted in
the prev. commit)
|
|
|
|
|
|
|
| |
2) Localize
PR: 95715
Submitted by: Li-Lun Wang <llwang@infor.org> (slightly edited by me)
|
|
|
|
|
|
|
|
|
| |
few bugs for a few corner cases and correctly handle the case where
read(2) is read()'ing from a non-file descriptor and could get fewer
bytes back than the buffer, but it isn't EOF[2]. random(6) extensively
tested and believed to be bug free (save performance for large files).
Submitted by: mkm [1], tjr[2]
|
|
off of lines or words. See the man page for details.
Reviewed by: markm
MFC after: 3 days
|