diff options
author | green <green@FreeBSD.org> | 1999-06-20 14:58:55 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 1999-06-20 14:58:55 +0000 |
commit | 788bc0cf602a4339422fb952290bf85f5e320e07 (patch) | |
tree | 6d6fc3c96961d0a8f6b4ab0507fdfeac4a671380 /bin/dd/conv.c | |
parent | 615565283ac17a71ab572b235e8e2ec107b6dfe1 (diff) | |
download | FreeBSD-src-788bc0cf602a4339422fb952290bf85f5e320e07.zip FreeBSD-src-788bc0cf602a4339422fb952290bf85f5e320e07.tar.gz |
This is the second round of dd(1) changes. Some changes made/reversed by
request of Bruce. More changes may follow later. 'g' multiplier has
been added (i.e. dd seek=5g if=bigfile.) Some minor corrections were made
as well.
Noticed by: bde
Diffstat (limited to 'bin/dd/conv.c')
-rw-r--r-- | bin/dd/conv.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/bin/dd/conv.c b/bin/dd/conv.c index d0cfe15..060b175 100644 --- a/bin/dd/conv.c +++ b/bin/dd/conv.c @@ -60,7 +60,7 @@ static const char rcsid[] = void def() { - size_t cnt; + int cnt; u_char *inp, *t; if ((t = ctab) != NULL) @@ -104,8 +104,7 @@ void block() { static int intrunc; - int ch; - size_t cnt, maxlen; + int ch, cnt, maxlen; u_char *inp, *outp, *t; /* @@ -137,11 +136,11 @@ block() maxlen = MIN(cbsz, in.dbcnt); if ((t = ctab) != NULL) for (cnt = 0; cnt < maxlen && (ch = *inp++) != '\n'; - ++cnt) + ++cnt) *outp++ = t[ch]; else for (cnt = 0; cnt < maxlen && (ch = *inp++) != '\n'; - ++cnt) + ++cnt) *outp++ = ch; /* * Check for short record without a newline. Reassemble the @@ -200,7 +199,7 @@ block_close() ++st.trunc; memmove(out.dbp, in.dbp - in.dbcnt, in.dbcnt); (void)memset(out.dbp + in.dbcnt, ctab ? ctab[' '] : ' ', - cbsz - in.dbcnt); + cbsz - in.dbcnt); out.dbcnt += cbsz; } } @@ -215,7 +214,7 @@ block_close() void unblock() { - size_t cnt; + int cnt; u_char *inp, *t; /* Translation and case conversion. */ @@ -248,7 +247,7 @@ unblock() void unblock_close() { - size_t cnt; + int cnt; u_char *t; if (in.dbcnt) { |