diff buffer.c @ 179:161557a9dde8

* fix longstanding bug with connections being closed on failure to connect to auth socket (server) * differentiate between get_byte and get_bool * get rid of some // comments * general tidying
author Matt Johnston <matt@ucc.asn.au>
date Sun, 13 Mar 2005 13:58:14 +0000
parents 0cfba3034be5
children c5d3ef11155f
line wrap: on
line diff
--- a/buffer.c	Sun Mar 13 12:03:27 2005 +0000
+++ b/buffer.c	Sun Mar 13 13:58:14 2005 +0000
@@ -160,6 +160,16 @@
 	return buf->data[buf->pos++];
 }
 
+/* Get a bool from the buffer and increment the pos */
+unsigned char buf_getbool(buffer* buf) {
+
+	unsigned char b;
+	b = buf_getbyte(buf);
+	if (b != 0)
+		b = 1;
+	return b;
+}
+
 /* put a byte, incrementing the length if required */
 void buf_putbyte(buffer* buf, unsigned char val) {