summaryrefslogtreecommitdiff
path: root/compress.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-01-22 23:18:15 +1100
committerDamien Miller <djm@mindrot.org>2002-01-22 23:18:15 +1100
commit708d21c8028ed2bf137a0c4ff75bf7c6bfeff6e9 (patch)
treee878520026f2a9e970f4152da6ffb3b864a2a195 /compress.c
parentdc9e067614947f2f2b0866cb1bc75e6ac620fb7f (diff)
- stevesk@cvs.openbsd.org 2001/12/29 21:56:01
[authfile.c channels.c compress.c packet.c sftp-server.c ssh-agent.c ssh-keygen.c] remove unneeded casts and some char->u_char cleanup; ok markus@
Diffstat (limited to 'compress.c')
-rw-r--r--compress.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/compress.c b/compress.c
index 73aebe89a..3badbf452 100644
--- a/compress.c
+++ b/compress.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: compress.c,v 1.16 2001/12/19 07:18:56 deraadt Exp $"); 15RCSID("$OpenBSD: compress.c,v 1.17 2001/12/29 21:56:01 stevesk Exp $");
16 16
17#include "log.h" 17#include "log.h"
18#include "buffer.h" 18#include "buffer.h"
@@ -80,7 +80,7 @@ buffer_compress_uninit(void)
80void 80void
81buffer_compress(Buffer * input_buffer, Buffer * output_buffer) 81buffer_compress(Buffer * input_buffer, Buffer * output_buffer)
82{ 82{
83 char buf[4096]; 83 u_char buf[4096];
84 int status; 84 int status;
85 85
86 /* This case is not handled below. */ 86 /* This case is not handled below. */
@@ -88,13 +88,13 @@ buffer_compress(Buffer * input_buffer, Buffer * output_buffer)
88 return; 88 return;
89 89
90 /* Input is the contents of the input buffer. */ 90 /* Input is the contents of the input buffer. */
91 outgoing_stream.next_in = (u_char *) buffer_ptr(input_buffer); 91 outgoing_stream.next_in = buffer_ptr(input_buffer);
92 outgoing_stream.avail_in = buffer_len(input_buffer); 92 outgoing_stream.avail_in = buffer_len(input_buffer);
93 93
94 /* Loop compressing until deflate() returns with avail_out != 0. */ 94 /* Loop compressing until deflate() returns with avail_out != 0. */
95 do { 95 do {
96 /* Set up fixed-size output buffer. */ 96 /* Set up fixed-size output buffer. */
97 outgoing_stream.next_out = (u_char *)buf; 97 outgoing_stream.next_out = buf;
98 outgoing_stream.avail_out = sizeof(buf); 98 outgoing_stream.avail_out = sizeof(buf);
99 99
100 /* Compress as much data into the buffer as possible. */ 100 /* Compress as much data into the buffer as possible. */
@@ -124,15 +124,15 @@ buffer_compress(Buffer * input_buffer, Buffer * output_buffer)
124void 124void
125buffer_uncompress(Buffer * input_buffer, Buffer * output_buffer) 125buffer_uncompress(Buffer * input_buffer, Buffer * output_buffer)
126{ 126{
127 char buf[4096]; 127 u_char buf[4096];
128 int status; 128 int status;
129 129
130 incoming_stream.next_in = (u_char *) buffer_ptr(input_buffer); 130 incoming_stream.next_in = buffer_ptr(input_buffer);
131 incoming_stream.avail_in = buffer_len(input_buffer); 131 incoming_stream.avail_in = buffer_len(input_buffer);
132 132
133 for (;;) { 133 for (;;) {
134 /* Set up fixed-size output buffer. */ 134 /* Set up fixed-size output buffer. */
135 incoming_stream.next_out = (u_char *) buf; 135 incoming_stream.next_out = buf;
136 incoming_stream.avail_out = sizeof(buf); 136 incoming_stream.avail_out = sizeof(buf);
137 137
138 status = inflate(&incoming_stream, Z_PARTIAL_FLUSH); 138 status = inflate(&incoming_stream, Z_PARTIAL_FLUSH);