Thanks. That fixed it, both shuffling and reinitialisation.char buffer[] = "----";
Me too. Plus the fact that it seems to be able to update 'buffer[3]' in both cases, and prints a non-weird string in both cases. I was expecting something to be 'more odd or bizarre' than that if I was doing something intrinsically wrong.I'm surprised that -Wall -Werror didn't reject that, with a compilation error message that would have explained the problem.
Part of the issue appears to be because I was building Run in RAM. Built with Run from Flash it does appear that it partially worked in the -O3 case because everything is in RAM. When -O3 and in Flash -
Code:
Enter password[----][----][----][----]
When -O0 and in Flash it simply crashes and hangs 'minicom' after the third key press, needs a power-cycle reset.
I guess 'idiots like me' coming along is why there's such interest in Rust and its proclaimed memory safety.
Statistics: Posted by hippy — Mon May 06, 2024 7:32 pm