diff --git a/src/blinky.c b/src/blinky.c index e61fcea..05f5a4f 100644 --- a/src/blinky.c +++ b/src/blinky.c @@ -213,7 +213,7 @@ int main(void) unsigned int nr_tim = 4; /* Relocate DATA. Initialise BSS. */ - if (_sdat != _ldat) + if (&_sdat[0] != &_ldat[0]) memcpy(_sdat, _ldat, _edat-_sdat); memset(_sbss, 0, _ebss-_sbss); diff --git a/src/fw_update.c b/src/fw_update.c index 60e9090..d9631cd 100644 --- a/src/fw_update.c +++ b/src/fw_update.c @@ -304,7 +304,7 @@ static bool_t enter_bootloader(void) int main(void) { /* Relocate DATA. Initialise BSS. */ - if (_sdat != _ldat) + if (&_sdat[0] != &_ldat[0]) memcpy(_sdat, _ldat, _edat-_sdat); memset(_sbss, 0, _ebss-_sbss); diff --git a/src/main.c b/src/main.c index 820533e..6f2becd 100644 --- a/src/main.c +++ b/src/main.c @@ -25,7 +25,7 @@ static void canary_check(void) int main(void) { /* Relocate DATA. Initialise BSS. */ - if (_sdat != _ldat) + if (&_sdat[0] != &_ldat[0]) memcpy(_sdat, _ldat, _edat-_sdat); memset(_sbss, 0, _ebss-_sbss);