From 871288ee12b9163ac8d4ccc67b14de1bd138a44f Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Mon, 18 Nov 2024 20:15:15 -0500 Subject: [PATCH] Fix Example Mod (Again) --- example-mods/chat-commands/chat-commands.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/example-mods/chat-commands/chat-commands.cpp b/example-mods/chat-commands/chat-commands.cpp index 30350521be..3791c39fa0 100644 --- a/example-mods/chat-commands/chat-commands.cpp +++ b/example-mods/chat-commands/chat-commands.cpp @@ -17,9 +17,8 @@ HOOK(chat_handle_packet_send, void, (const Minecraft *minecraft, ChatPacket *pac if (out.length() > 0 && out[out.length() - 1] == '\n') { out[out.length() - 1] = '\0'; } - char *cp437_out = to_cp437(out.c_str()); + std::string cp437_out = to_cp437(out); gui->addMessage(cp437_out); - free(cp437_out); } else { // Call Original Method real_chat_handle_packet_send()(minecraft, packet);