maxnut / GDMegaOverlay

Free geometry dash mod menu with useful features such as: startpos switcher, show hitboxes, internal recorder, macro bot, clickbot and much more
GNU General Public License v3.0
277 stars 45 forks source link

Unnecessary if statement #230

Closed Antosser closed 6 months ago

Antosser commented 7 months ago

https://github.com/maxnut/GDMegaOverlay/blame/1fb35e2a248a472693ceed1b713d18c422af1114/src/Macrobot/Record.cpp#L56

Stronkkey commented 7 months ago

https://stackoverflow.com/questions/1073157/zero-size-malloc

The behaviour is implementation defined, you will receive either a NULL pointer or an address.

I am not sure how safe it is to pass a NULL pointer to the WideCharToMultiByte function. Regardless, you can simply return a empty string in the condition. It might be better to use an external library for conversion.

maxnut commented 6 months ago

removed them in 8c429bc32bda5a32615d0537d612d8463926180c because they were unused

Stronkkey commented 6 months ago

Why did you even add them in the first place?