diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-11-24 00:26:05 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-11-24 00:26:05 +0000 |
commit | c14bc793676af72a37a3dec0514535ee5d518544 (patch) | |
tree | b3aa555770da23872b7868223533bc73a29128fb /usr.bin/ssh/bufaux.c | |
parent | e668e96ab6ba981bc7469cc91eebd045bb4d7898 (diff) |
much more KNF
Diffstat (limited to 'usr.bin/ssh/bufaux.c')
-rw-r--r-- | usr.bin/ssh/bufaux.c | 82 |
1 files changed, 45 insertions, 37 deletions
diff --git a/usr.bin/ssh/bufaux.c b/usr.bin/ssh/bufaux.c index 8b6f7b43740..6b59c8f1d91 100644 --- a/usr.bin/ssh/bufaux.c +++ b/usr.bin/ssh/bufaux.c @@ -1,21 +1,21 @@ /* - -bufaux.c - -Author: Tatu Ylonen <ylo@cs.hut.fi> - -Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland - All rights reserved - -Created: Wed Mar 29 02:24:47 1995 ylo - -Auxiliary functions for storing and retrieving various data types to/from -Buffers. - -*/ + * + * bufaux.c + * + * Author: Tatu Ylonen <ylo@cs.hut.fi> + * + * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland + * All rights reserved + * + * Created: Wed Mar 29 02:24:47 1995 ylo + * + * Auxiliary functions for storing and retrieving various data types to/from + * Buffers. + * + */ #include "includes.h" -RCSID("$Id: bufaux.c,v 1.5 1999/11/23 22:25:52 markus Exp $"); +RCSID("$Id: bufaux.c,v 1.6 1999/11/24 00:26:01 deraadt Exp $"); #include "ssh.h" #include <ssl/bn.h> @@ -23,9 +23,10 @@ RCSID("$Id: bufaux.c,v 1.5 1999/11/23 22:25:52 markus Exp $"); #include "xmalloc.h" #include "getput.h" -/* Stores an BIGNUM in the buffer with a 2-byte msb first bit count, followed - by (bits+7)/8 bytes of binary data, msb first. */ - +/* + * Stores an BIGNUM in the buffer with a 2-byte msb first bit count, followed + * by (bits+7)/8 bytes of binary data, msb first. + */ void buffer_put_bignum(Buffer *buffer, BIGNUM *value) { @@ -51,8 +52,9 @@ buffer_put_bignum(Buffer *buffer, BIGNUM *value) xfree(buf); } -/* Retrieves an BIGNUM from the buffer. */ - +/* + * Retrieves an BIGNUM from the buffer. + */ int buffer_get_bignum(Buffer *buffer, BIGNUM *value) { @@ -73,8 +75,9 @@ buffer_get_bignum(Buffer *buffer, BIGNUM *value) return 2 + bytes; } -/* Returns an integer from the buffer (4 bytes, msb first). */ - +/* + * Returns an integer from the buffer (4 bytes, msb first). + */ unsigned int buffer_get_int(Buffer *buffer) { @@ -83,8 +86,9 @@ buffer_get_int(Buffer *buffer) return GET_32BIT(buf); } -/* Stores an integer in the buffer in 4 bytes, msb first. */ - +/* + * Stores an integer in the buffer in 4 bytes, msb first. + */ void buffer_put_int(Buffer *buffer, unsigned int value) { @@ -93,13 +97,14 @@ buffer_put_int(Buffer *buffer, unsigned int value) buffer_append(buffer, buf, 4); } -/* Returns an arbitrary binary string from the buffer. The string cannot - be longer than 256k. The returned value points to memory allocated - with xmalloc; it is the responsibility of the calling function to free - the data. If length_ptr is non-NULL, the length of the returned data - will be stored there. A null character will be automatically appended - to the returned string, and is not counted in length. */ - +/* + * Returns an arbitrary binary string from the buffer. The string cannot + * be longer than 256k. The returned value points to memory allocated + * with xmalloc; it is the responsibility of the calling function to free + * the data. If length_ptr is non-NULL, the length of the returned data + * will be stored there. A null character will be automatically appended + * to the returned string, and is not counted in length. + */ char * buffer_get_string(Buffer *buffer, unsigned int *length_ptr) { @@ -121,8 +126,9 @@ buffer_get_string(Buffer *buffer, unsigned int *length_ptr) return value; } -/* Stores and arbitrary binary string in the buffer. */ - +/* + * Stores and arbitrary binary string in the buffer. + */ void buffer_put_string(Buffer *buffer, const void *buf, unsigned int len) { @@ -130,8 +136,9 @@ buffer_put_string(Buffer *buffer, const void *buf, unsigned int len) buffer_append(buffer, buf, len); } -/* Returns a character from the buffer (0 - 255). */ - +/* + * Returns a character from the buffer (0 - 255). + */ int buffer_get_char(Buffer *buffer) { @@ -140,8 +147,9 @@ buffer_get_char(Buffer *buffer) return (unsigned char) ch; } -/* Stores a character in the buffer. */ - +/* + * Stores a character in the buffer. + */ void buffer_put_char(Buffer *buffer, int value) { |