#Logging causes variable to change randomly

4 messages · Page 1 of 1 (latest)

night citrus
#

I'm currently working on a small project to try and make a rom file manager, and one aspect of this is using libgcrypt to encrypt said rom files. After implementing my own logger however i've encountered a really strange error, using the logger causes the string length of the encrypted text to change unexpectedly, which causes the decryption test to fail. Without the calls to the logger the tests work perfectly, but if i attempt to call the logger everything breaks.

Source code is here:
https://github.com/jjlrjjlr/Ludivum

And the three relevent files are:
https://github.com/jjlrjjlr/Ludivum/blob/master/src/logger/Logger.cpp
https://github.com/jjlrjjlr/Ludivum/blob/master/tests/Test.cpp
https://github.com/jjlrjjlr/Ludivum/blob/master/src/core/Encryption.cpp

And the call to the logger that braeks everything is here:
https://github.com/jjlrjjlr/Ludivum/blob/master/src/core/FileReader.cpp#L15

orchid rivetBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

thorny bluff
#

which specific variable is the one that changes when you use the logger?

#

first question is have you stepped through the code with a debugger to see if anything looks off that might be causing some weird interaction between whatever the logger is doing and that variable?