Permalink
Browse files

fix off-by-one in nkeeprom

  • Loading branch information...
1 parent 12b5dc1 commit cd354614af91df547590822e01deda2471fe7d94 @beerriot committed Feb 26, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/nkeeprom.c
View
@@ -27,11 +27,11 @@ void nkeeprom_write_byte(char byte, uint16_t address) {
}
void nkeeprom_read_bytes(unsigned char* dest, int offset, int count) {
- for (; count >= 0; count--, dest++, offset++)
+ for (; count > 0; count--, dest++, offset++)
*dest = nkeeprom_read_byte(offset);
}
void nkeeprom_write_bytes(unsigned char* src, int offset, int count) {
- for(; count >= 0; count--, src++, offset++)
+ for(; count > 0; count--, src++, offset++)
nkeeprom_write_byte(*src, offset);
}

0 comments on commit cd35461

Please sign in to comment.