-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concat operator + with random() value leads to crash #143
Comments
Maybe something for you @per1234 ? :-) |
I believe what happens here is that You could probably try:
and this would print
(or some other similarly big number which goes beyond the end of RAM) and this will also crash. I'm inclined to close this as not a bug, since this is expected behavior (C-style strings do not support concatenation with |
@matthijskooijman What you're saying makes total sense! Thanks for sharing that. There is indeed an assignment operator |
I found that when I concatenate a string directly (without wrapping it in a String object) with a number obtained from
random()
I get strange results.When
random()
is used with a parameter, the resulting string contains garbage obtained from memory where it probably shouldn't read from.When using
random()
without parameter the program crashes. On Portenta I get the red S.O.S flash, on the MKR1000 for example it just stops responding. I started to investigate but haven't found the culprit yet. It crashes somewhere inconcat()
when reading the string length usingstrlen()
.The text was updated successfully, but these errors were encountered: