From bb9d038829e2c23d77a9a468ac6fdb0ca8fc65a9 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Thu, 21 Jul 2011 19:02:01 +0200 Subject: [PATCH] Fix crash on OK after Save Changes in Tags and Comment popup. The global variables tagsText and commentText were used to pass a string obtained from a widget (and thus not malloc'ed), which caused a crash when the GenericReadout tried to use those variables for the new value. Fixed by using GenericReadout (which does malloc) to read out the text,in stead of GetWidgetText. --- xoptions.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xoptions.c b/xoptions.c index bafa8bb..437ebae 100644 --- a/xoptions.c +++ b/xoptions.c @@ -1395,7 +1395,7 @@ int NewComCallback(int n) void SaveChanges(int n) { - GetWidgetText(¤tOption[0], &commentText); + GenericReadout(0); ReplaceComment(commentIndex, commentText); } @@ -1446,7 +1446,7 @@ int NewTagsCallback(int n) void changeTags(int n) { - GetWidgetText(¤tOption[1], &tagsText); + GenericReadout(1); if(bookUp) SaveToBook(tagsText); else ReplaceTags(tagsText, &gameInfo); } -- 1.7.0.4