fix compiler warning: avoid going out of array bounds

This commit is contained in:
marschap
2008-10-08 20:19:37 +00:00
parent 58c93a6bb5
commit 6b7db138d6
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -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);
} }
+1 -1
View File
@@ -84,7 +84,7 @@ typedef struct
int C_state; int C_state;
/* led handling */ /* led handling */
char led[7]; char led[8];
} PrivateData; } PrivateData;