christos
a0c086aaf2
Coverity CID 2989: Use the error path to return.
2006-05-01 23:31:10 +00:00
christos
83d63c0a25
Coverity CID 2996: Don't return without closing fp.
2006-05-01 23:22:48 +00:00
christos
0ced32c669
Rename cat to tset_cat so that coverity does not get confused by the global
...
name.
2006-05-01 23:18:37 +00:00
christos
ed5c178a35
Use errx instead of fprintf/fputs.
2006-05-01 23:12:24 +00:00
christos
9136a179f7
Coverity CID 1198: Avoid closing a negative fd.
2006-05-01 23:06:55 +00:00
christos
85576ae019
Coverity CID 1224: Avoid closing a negative fd.
2006-05-01 23:05:24 +00:00
christos
20fe0cf746
Coverity CID 1447: Avoid buffer overflow.
2006-05-01 23:02:03 +00:00
christos
186743bc31
Coverity CID 1448: Avoid static array overflow.
2006-05-01 23:00:33 +00:00
christos
05d6ead1e0
Coverity CID 1223: Avoid calling close with a negative fd.
2006-05-01 22:57:16 +00:00
christos
7c1fafb5f3
Coverity CID 1233: Avoid negative index.
2006-05-01 22:55:50 +00:00
christos
501be8b824
Need assert.h now.
2006-05-01 05:14:22 +00:00
christos
e408cc2631
Coverity CID 766: Add assertion before pointer deref.
2006-05-01 05:13:58 +00:00
christos
76c6077db0
Coverity CID 815: Avoid NULL pointer deref.
2006-05-01 05:04:02 +00:00
christos
f2dd1e3c0c
Coverity CID 1772: Close file on error return.
2006-05-01 00:03:15 +00:00
christos
4f0fad7e36
Coverity CID 814: Add extraneous checks to shut up Coverity.
2006-05-01 00:00:12 +00:00
christos
f5c3fa40c3
Coverity CID 1206: Confusion between && and || leads to indexing an array
...
with negative index.
2006-04-30 23:56:42 +00:00
christos
1af32ba03a
Coverity CID 1566: fix memory leak.
2006-04-30 23:54:40 +00:00
christos
1f74082c09
Coverity CID 1972: Don't leak file descriptor.
2006-04-30 23:52:14 +00:00
christos
781d14720c
Coverity CID 1599: Fix memory leak.
2006-04-30 23:49:34 +00:00
christos
fc56e77334
Coverity CID 1483: Off-by-one stack overflow.
2006-04-30 23:43:31 +00:00
christos
9ff5bf4b8a
Coverity CID 788: Fix null pointer deref.
2006-04-30 23:42:06 +00:00
christos
4f6d3973bf
Coverity CID 787: Fix null pointer deref.
2006-04-30 23:40:20 +00:00
christos
0b78752ab3
Coverity CID 749: Comment out dead code.
2006-04-30 23:38:34 +00:00
christos
f84f0d3321
Coverity CID 2972, 2973: Don't call close() with a negative fd.
2006-04-30 23:34:50 +00:00
christos
011be34f91
Coverity CID 1565: Fix memory leak.
2006-04-30 23:30:13 +00:00
christos
7d7dff8590
Coverity CID 2986: Free lines before returning.
2006-04-30 23:27:15 +00:00
liamjfoy
9a4f3f0f6e
remove an unused variable
...
ok christos
2006-04-30 20:23:02 +00:00
liamjfoy
4ed54cf43d
Remove Pflag variable. its unused.
...
ok christos@
2006-04-30 19:24:50 +00:00
christos
0f2aabcd39
Coverity CID 1858, 1857: Fix leaks. While here, pass lint use warn/warnx
...
instead of perror/fprintf. KNF.
2006-04-28 20:35:15 +00:00
christos
69f8117233
Coverity CID 873: Only align if we printed a string.
2006-04-28 20:07:57 +00:00
christos
61e04d677f
Coverity CID 874: Don't check local; it cannot be NULL.
2006-04-28 20:06:50 +00:00
christos
fc5177078a
Coverity CID 875: local is not allowed to be NULL; don't check for it.
2006-04-28 20:05:43 +00:00
christos
32d85d8f66
Coverity CID 2194: Don't forget to free port.
2006-04-28 20:02:07 +00:00
christos
5c8a52b0f1
Coverity CID 2195: Free path in all code paths, not some.
2006-04-28 19:59:44 +00:00
christos
e8877ca717
Coverity CID 1780, 1779: Fix memory leak.
2006-04-28 19:53:56 +00:00
simonb
47890115bd
Unwrap a not too long line.
2006-04-27 09:04:41 +00:00
christos
63b0d1ab71
Coverity CID 2790: Always free tmp buffer, not somethimes.
2006-04-25 19:34:42 +00:00
christos
4d5030b7d4
Coverity CID 2969: Check for negative stack in the 'P' case like we do in
...
the 0 case.
2006-04-25 19:25:19 +00:00
wiz
61152e3f56
Document more explicitly that -c takes an optional file argument.
2006-04-24 22:00:43 +00:00
hubertf
0b4add3077
Allow reading the checksum list from stdin if no file is given with -c.
...
This allows verifying the checksums e.g. after downloading a NetBSD
release:
cat BSDSUM CKSUM MD5 SHA512 SYSVSUM | cksum -c
2006-04-24 21:07:43 +00:00
hubertf
1e8e9dee9c
Try guessing hash types. Prefix output with hash type,
...
the output format was inspired by Linux & OpenBSD.
This now allows doing something like:
miyu% ( md4 *.c ; md5 *.c ; sha1 *.c ) > /tmp/x
miyu% md5 -c /tmp/x
miyu% cksum -c /tmp/x
miyu% echo $?
0
miyu% date >test.c
miyu% cksum -c /tmp/x
(MD4) test.c: FAILED
(MD5) test.c: FAILED
(SHA1) test.c: FAILED
miyu% echo $?
1
2006-04-24 19:41:41 +00:00
jld
c861d33e38
Make yes exit if a write fails (due to, e.g., EPIPE or revocation).
...
With advice from rillig@; discussed on tech-userlevel on 2005-11-18.
2006-04-24 05:24:03 +00:00
wiz
f255a1f958
A fix for HTML output; punctuation nits.
2006-04-23 17:45:04 +00:00
hubertf
944a4820a3
Document -w, too.
2006-04-23 16:48:02 +00:00
hubertf
f9e91b57ed
Add a switch "-c file" to verify a list of checksums generated by the
...
cksum program and stored in file against files on disk. E.g. first
run "md5 *.tgz >MD5" to generate a list of MD5 checksums in MD5, then
use the following command to verify them use "md5 -c MD5"
Inspired by Linux' md5sum,
called for by Jukka Salmi <j+nbsd@2006.salmi.ch>on netbsd-help@,
reviewed by rui@.
2006-04-23 16:40:16 +00:00
christos
328064d112
Redo the previous change so that we can ignore access errors from find,
...
but also tell when writing to the output file failed, by using a pipeline
to cat. While here change `` to $(). Otherwise this would always fail
since it is ran as nobody and therefore it cannot access some files. Reported
by smb.
2006-04-23 03:04:08 +00:00
christos
731b0f1073
Coverity CID 522: Clarify that there is no overrun here.
2006-04-22 20:51:09 +00:00
christos
3d5b8ce5a8
Coverity CID 529: Call VarFreeEnv to prevent leak.
2006-04-22 19:40:40 +00:00
christos
ac5c384e1b
Coverity CID 534: Free junk variables on return from Var_Parse.
2006-04-22 19:32:35 +00:00
christos
bb46846e03
Coverity CID 533: Plug memory leak.
...
Add a new function VarFreeEnv() to free environment variables and use it.
2006-04-22 19:28:51 +00:00