JustasMasiulis / xorstr

heavily vectorized c++17 compile time string encryption.
Apache License 2.0
1.19k stars 193 forks source link

incorrect string #30

Closed ghost closed 4 years ago

ghost commented 4 years ago

image image

ghost commented 4 years ago

I think that str1 is a dangling pointer. I have only one question: why the same code works fine with std::string (...).c_str()?

JustasMasiulis commented 4 years ago

duplicate #26, #27

I think that str1 is a dangling pointer.

Yep. str2 is a dangling pointer too btw.

I have only one question: why the same code works fine with std::string (...).c_str()?

🤷 just lucky I guess, because it shouldn't and most likely if you just add some more stuff it will instantly break.