mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
apps/dfu/main.c: Avoid variable declaration in for loop initial
This fixes the following compile error:
apps/dfu/main.c:73:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
for (unsigned int i=0; i<len; i++) {
^
apps/dfu/main.c:73:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
which was recently introduced in b73f0a00bc
This commit is contained in:
@@ -31,6 +31,7 @@ int USBDFU_handle_dnload(uint8_t altif, unsigned int offset,
|
||||
uint8_t *data, unsigned int len)
|
||||
{
|
||||
uint32_t addr;
|
||||
unsigned int i;
|
||||
int rc;
|
||||
/* address of the last allocated variable on the stack */
|
||||
uint32_t stack_addr = (uint32_t)&rc;
|
||||
@@ -70,7 +71,7 @@ int USBDFU_handle_dnload(uint8_t altif, unsigned int offset,
|
||||
/* FIXME: set error codes */
|
||||
return DFU_RET_STALL;
|
||||
}
|
||||
for (unsigned int i=0; i<len; i++) {
|
||||
for (i = 0; i < len; i++) {
|
||||
if (((uint8_t*)addr)[i]!=data[i]) {
|
||||
TRACE_ERROR("DFU download flash data written not correct\n\r");
|
||||
return DFU_RET_STALL;
|
||||
|
||||
Reference in New Issue
Block a user