summaryrefslogtreecommitdiff
path: root/src/interface.c
diff options
context:
space:
mode:
authorjacksonmj <jacksonmj@jacksonmj.none>2011-01-30 22:37:59 (GMT)
committer jacksonmj <jacksonmj@jacksonmj.none>2011-01-30 22:37:59 (GMT)
commite2b916a91fcd0563853e45a8a8c509d63876e8e5 (patch)
treee5f09047773cbc91832c085670ca3e760ca190db /src/interface.c
parentf97990fedd034e013d27bfb83a6196ab0d4c9a66 (diff)
downloadpowder-e2b916a91fcd0563853e45a8a8c509d63876e8e5.zip
powder-e2b916a91fcd0563853e45a8a8c509d63876e8e5.tar.gz
Console segfault fix
ed.str is deallocated when console_ui returns. Dereferencing the returned pointer to ed.str therefore results in bad things.
Diffstat (limited to 'src/interface.c')
-rw-r--r--src/interface.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/interface.c b/src/interface.c
index e345007..d020bf6 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -3883,7 +3883,7 @@ char *console_ui(pixel *vid_buf,char error[255]) { //TODO: error messages, show
currentcommand->prev_command = last_command;
currentcommand->command = mystrdup(ed.str);
last_command = currentcommand;
- return ed.str;
+ return currentcommand->command;
}
if (sdl_key==SDLK_ESCAPE || sdl_key==SDLK_BACKQUOTE)
{