changeset 4:56f53e48ab50

Fix off by one bug in protocol extension negotiation. Arrays are indexed from zero!!!!
author William Astle <lost@l-w.ca>
date Sun, 29 May 2016 21:50:51 -0600
parents e94940ca17e7
children 422f5e8fff85
files src/lwwire.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lwwire.c	Sun May 29 11:10:25 2016 -0600
+++ b/src/lwwire.c	Sun May 29 21:50:51 2016 -0600
@@ -336,7 +336,7 @@
 	if (lwwire_read(buf, 1) < 0)
 		return;
 	// NAK the request
-	buf[1] = 0x55;
+	buf[0] = 0x55;
 	lwwire_write(buf, 1);
 }
 
@@ -347,7 +347,7 @@
 	if (lwwire_read(buf, 1) < 0)
 		return;
 	// ACK disabling any unsupported extensions
-	buf[1] = 0x42;
+	buf[0] = 0x42;
 	lwwire_write(buf, 1);
 }