summaryrefslogtreecommitdiff
path: root/n
diff options
context:
space:
mode:
authordemonchy2005-04-17 02:48:16 +0000
committerdemonchy2005-04-17 02:48:16 +0000
commit55adcd9b39c4bc26ecedba64a5ece61fe987a8aa (patch)
tree93dc6950bdc657627456015f88973878d53ac122 /n
parent3e20c577153b088ba735e511cf72d4eaaa6775e9 (diff)
Correction du buffer overflow de la réception
Diffstat (limited to 'n')
-rw-r--r--n/avr/twi-master/twi_master.c2
1 files changed, 1 insertions, 1 deletions
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 */