diff --git a/tools/rexm/rexm.c b/tools/rexm/rexm.c index 48a621115..d54760023 100644 --- a/tools/rexm/rexm.c +++ b/tools/rexm/rexm.c @@ -1572,13 +1572,13 @@ int main(int argc, char *argv[]) " SaveFileText(\"outputLogFileName\", logText);\n" " emscripten_run_script(\"saveFileFromMEMFSToDisk('outputLogFileName','outputLogFileName')\");\n\n" " return 0"; - char *returnReplaceTextUpdated = TextReplacEx(returnReplaceText, "outputLogFileName", TextFormat("%s.log", exName)); + char *returnReplaceTextUpdated = TextReplaceAlloc(returnReplaceText, "outputLogFileName", TextFormat("%s.log", exName)); char *srcTextUpdated[4] = { 0 }; - srcTextUpdated[0] = TextReplacEx(srcText, "int main(void)\n{", mainReplaceText); - srcTextUpdated[1] = TextReplacEx(srcTextUpdated[0], "WindowShouldClose()", "WindowShouldClose() && (testFramesCount < requestedTestFrames)"); - srcTextUpdated[2] = TextReplacEx(srcTextUpdated[1], "EndDrawing();", "EndDrawing(); testFramesCount++;"); - srcTextUpdated[3] = TextReplacEx(srcTextUpdated[2], " return 0", returnReplaceTextUpdated); + srcTextUpdated[0] = TextReplaceAlloc(srcText, "int main(void)\n{", mainReplaceText); + srcTextUpdated[1] = TextReplaceAlloc(srcTextUpdated[0], "WindowShouldClose()", "WindowShouldClose() && (testFramesCount < requestedTestFrames)"); + srcTextUpdated[2] = TextReplaceAlloc(srcTextUpdated[1], "EndDrawing();", "EndDrawing(); testFramesCount++;"); + srcTextUpdated[3] = TextReplaceAlloc(srcTextUpdated[2], " return 0", returnReplaceTextUpdated); MemFree(returnReplaceTextUpdated); UnloadFileText(srcText); @@ -1628,9 +1628,9 @@ int main(int argc, char *argv[]) " if ((argc > 1) && (argc == 3) && (strcmp(argv[1], \"--frames\") != 0)) requestedTestFrames = atoi(argv[2]);\n"; char *srcTextUpdated[3] = { 0 }; - srcTextUpdated[0] = TextReplacEx(srcText, "int main(void)\n{", mainReplaceText); - srcTextUpdated[1] = TextReplacEx(srcTextUpdated[0], "WindowShouldClose()", "WindowShouldClose() && (testFramesCount < requestedTestFrames)"); - srcTextUpdated[2] = TextReplacEx(srcTextUpdated[1], "EndDrawing();", "EndDrawing(); testFramesCount++;"); + srcTextUpdated[0] = TextReplaceAlloc(srcText, "int main(void)\n{", mainReplaceText); + srcTextUpdated[1] = TextReplaceAlloc(srcTextUpdated[0], "WindowShouldClose()", "WindowShouldClose() && (testFramesCount < requestedTestFrames)"); + srcTextUpdated[2] = TextReplaceAlloc(srcTextUpdated[1], "EndDrawing();", "EndDrawing(); testFramesCount++;"); UnloadFileText(srcText); SaveFileText(TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName), srcTextUpdated[2]);