summaryrefslogtreecommitdiffhomepage
path: root/buffer.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2005-03-13 13:58:14 +0000
committerMatt Johnston <matt@ucc.asn.au>2005-03-13 13:58:14 +0000
commitf45eafe342aa07dfdc7a83e865b642f9b8ef2fa0 (patch)
tree420b80af3728353ee1a4151ecd32d627a48c1fdf /buffer.c
parenta68755af2bbc2e34ad23a74fc4d9d5c58502aa14 (diff)
* 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 --HG-- extra : convert_revision : fb8d188ce33b6b45804a5ce51b9f601f83bdf3d7
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/buffer.c b/buffer.c
index dff861f..97045ff 100644
--- a/buffer.c
+++ b/buffer.c
@@ -160,6 +160,16 @@ unsigned char buf_getbyte(buffer* buf) {
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) {