fix compiler warning: avoid going out of array bounds
This commit is contained in:
@@ -281,9 +281,9 @@ set_leds(PrivateData *p)
|
||||
int i;
|
||||
char tele[3]="L00";
|
||||
|
||||
for (i=0; i<7; i++) {
|
||||
tele[1]=i+'1';
|
||||
tele[2]=p->led[i]?'1':'0';
|
||||
for (i = 0; i < 7; i++) {
|
||||
tele[1] = i + '1';
|
||||
tele[2] = p->led[i] ? '1' : '0';
|
||||
send_tele(p, tele);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ typedef struct
|
||||
int C_state;
|
||||
|
||||
/* led handling */
|
||||
char led[7];
|
||||
char led[8];
|
||||
|
||||
} PrivateData;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user