From 55adcd9b39c4bc26ecedba64a5ece61fe987a8aa Mon Sep 17 00:00:00 2001 From: demonchy Date: Sun, 17 Apr 2005 02:48:16 +0000 Subject: Correction du buffer overflow de la réception --- n/avr/twi-master/twi_master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/n/avr/twi-master/twi_master.c b/n/avr/twi-master/twi_master.c index 932eff3..d0c7c73 100644 --- a/n/avr/twi-master/twi_master.c +++ b/n/avr/twi-master/twi_master.c @@ -184,7 +184,7 @@ SIGNAL (SIG_2WIRE_SERIAL) case TW_MR_DATA_ACK: buffer[twi_idx ++] = TWDR; TWI_DEBUG ('n'); - if (twi_idx == twi_len) + if (twi_idx == (twi_len - 1)) TWCR &= ~ _BV (TWEA); break; case TW_MR_DATA_NACK: /* dernier byte */ -- cgit v1.2.3