diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 1996-11-13 20:00:03 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 1996-11-13 20:00:03 +0000 |
commit | ad66f7ee71824d3ce1632bd78dc93bec28faa916 (patch) | |
tree | 53fc828f0ad161e700a6fc8fe723a969aade6a4b /bin/dd/conv.c | |
parent | ac55eca46c5814edfc2b195c47fa04bb5e48643a (diff) | |
download | src-ad66f7ee71824d3ce1632bd78dc93bec28faa916.tar.gz src-ad66f7ee71824d3ce1632bd78dc93bec28faa916.zip |
Notes
Diffstat (limited to 'bin/dd/conv.c')
-rw-r--r-- | bin/dd/conv.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/bin/dd/conv.c b/bin/dd/conv.c index 41c5909c03de..09ee56af0d07 100644 --- a/bin/dd/conv.c +++ b/bin/dd/conv.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: conv.c,v 1.3 1994/09/24 02:54:44 davidg Exp $ + * $Id: conv.c,v 1.4 1996/11/12 23:09:04 phk Exp $ */ #ifndef lint @@ -45,7 +45,6 @@ static char sccsid[] = "@(#)conv.c 8.3 (Berkeley) 4/2/94"; #include <err.h> #include <string.h> -#include <sys/time.h> #include "dd.h" #include "extern.h" @@ -62,7 +61,7 @@ def() int cnt; u_char *inp, *t; - if ((t = ctab)) + if ((t = ctab) != NULL) for (inp = in.dbp - (cnt = in.dbrcnt); cnt--; ++inp) *inp = t[*inp]; @@ -106,7 +105,6 @@ block() int ch, cnt, maxlen; u_char *inp, *outp, *t; - ch = 0; /* * Record truncation can cross block boundaries. If currently in a * truncation state, keep tossing characters until reach a newline. @@ -131,9 +129,10 @@ block() * Copy records (max cbsz size chunks) into the output buffer. The * translation is done as we copy into the output buffer. */ + ch = 0; /* Help the compiler. */ for (inp = in.dbp - in.dbcnt, outp = out.dbp; in.dbcnt;) { maxlen = MIN(cbsz, in.dbcnt); - if ((t = ctab)) + if ((t = ctab) != NULL) for (cnt = 0; cnt < maxlen && (ch = *inp++) != '\n'; ++cnt) *outp++ = t[ch]; @@ -217,7 +216,7 @@ unblock() u_char *inp, *t; /* Translation and case conversion. */ - if ((t = ctab)) + if ((t = ctab) != NULL) for (cnt = in.dbrcnt, inp = in.dbp; cnt--;) *--inp = t[*inp]; /* |