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