From 4af51306d9a51459a5bef922df1037f876ae51fe Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sun, 16 Apr 2000 11:18:38 +1000 Subject: - OpenBSD CVS updates. [ssh.1 ssh.c] - ssh -2 [auth.c channels.c clientloop.c packet.c packet.h serverloop.c] [session.c sshconnect.c] - check payload for (illegal) extra data [ALL] - whitespace cleanup --- buffer.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'buffer.c') diff --git a/buffer.c b/buffer.c index 48ae96a42..83a63e6f0 100644 --- a/buffer.c +++ b/buffer.c @@ -1,20 +1,20 @@ /* - * + * * buffer.c - * + * * Author: Tatu Ylonen - * + * * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved - * + * * Created: Sat Mar 18 04:15:33 1995 ylo - * + * * Functions for manipulating fifo buffers (that can grow if needed). - * + * */ #include "includes.h" -RCSID("$Id: buffer.c,v 1.4 2000/04/13 02:26:36 damien Exp $"); +RCSID("$Id: buffer.c,v 1.5 2000/04/16 01:18:40 damien Exp $"); #include "xmalloc.h" #include "buffer.h" @@ -22,7 +22,7 @@ RCSID("$Id: buffer.c,v 1.4 2000/04/13 02:26:36 damien Exp $"); /* Initializes the buffer structure. */ -void +void buffer_init(Buffer *buffer) { buffer->alloc = 4096; @@ -33,7 +33,7 @@ buffer_init(Buffer *buffer) /* Frees any memory used for the buffer. */ -void +void buffer_free(Buffer *buffer) { memset(buffer->buf, 0, buffer->alloc); @@ -45,7 +45,7 @@ buffer_free(Buffer *buffer) * zero the memory. */ -void +void buffer_clear(Buffer *buffer) { buffer->offset = 0; @@ -54,7 +54,7 @@ buffer_clear(Buffer *buffer) /* Appends data to the buffer, expanding it if necessary. */ -void +void buffer_append(Buffer *buffer, const char *data, unsigned int len) { char *cp; @@ -68,7 +68,7 @@ buffer_append(Buffer *buffer, const char *data, unsigned int len) * to the allocated region. */ -void +void buffer_append_space(Buffer *buffer, char **datap, unsigned int len) { /* If the buffer is empty, start using it from the beginning. */ @@ -102,7 +102,7 @@ restart: /* Returns the number of bytes of data in the buffer. */ -unsigned int +unsigned int buffer_len(Buffer *buffer) { return buffer->end - buffer->offset; @@ -110,7 +110,7 @@ buffer_len(Buffer *buffer) /* Gets data from the beginning of the buffer. */ -void +void buffer_get(Buffer *buffer, char *buf, unsigned int len) { if (len > buffer->end - buffer->offset) @@ -121,7 +121,7 @@ buffer_get(Buffer *buffer, char *buf, unsigned int len) /* Consumes the given number of bytes from the beginning of the buffer. */ -void +void buffer_consume(Buffer *buffer, unsigned int bytes) { if (bytes > buffer->end - buffer->offset) @@ -131,7 +131,7 @@ buffer_consume(Buffer *buffer, unsigned int bytes) /* Consumes the given number of bytes from the end of the buffer. */ -void +void buffer_consume_end(Buffer *buffer, unsigned int bytes) { if (bytes > buffer->end - buffer->offset) @@ -149,7 +149,7 @@ buffer_ptr(Buffer *buffer) /* Dumps the contents of the buffer to stderr. */ -void +void buffer_dump(Buffer *buffer) { int i; -- cgit v1.2.3