geode-sdk / geode

The ultimate Geometry Dash modding framework
https://geode-sdk.org/
Boost Software License 1.0
742 stars 131 forks source link

`utils::string::replace` hangs on empty strings #1162

Closed TechStudent10 closed 3 hours ago

TechStudent10 commented 4 hours ago

Geode Issue

Platform

Windows

SDK commit

No response

Geode Version

v4.0.0-beta

Mods Installed

No response

Expected Behavior

When attempting to use geode::utils::string::replace on an empty string, the code should return the empty string as there is nothing to replace.

Actual Behavior

Instead, it hangs. No crashes, just hangs on this single line of code.

Steps to Reproduce

  1. use geode::utils::string::replace where the original string is blank

Additional Information

No response

dankmeme01 commented 3 hours ago

could not reproduce the issue with the input string being blank, but if the orig parameter was blank, the function would indeed loop forever and hang. fixed in https://github.com/geode-sdk/geode/commit/4d5e465ade1464d2c0cd39eddd099328bd714fb6