summaryrefslogtreecommitdiffstats
path: root/bin/dd/conv.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/dd/conv.c')
-rw-r--r--bin/dd/conv.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/bin/dd/conv.c b/bin/dd/conv.c
index 41c5909..09ee56a 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];
/*
OpenPOWER on IntegriCloud