mirror of
https://github.com/clearml/dropbear
synced 2025-06-26 18:17:32 +00:00
* 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
This commit is contained in:
10
buffer.c
10
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) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user