This won't work - MCU_fix_path() previously modified the c-string that was passed into it. MCStringRef's are by default immutable, so this will have no effect (or break).

The signature for MCU_fix_path() should be - MCU_fix_path(MCStringRef in, MCStringRef& r_out)