summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-16 08:11:08 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-16 08:11:08 +0800
commit2f6b7f7d6735ef07831dd81c6f7db7646e525493 (patch)
treee91fe46c2290082a731e1fb5a66af45c3c96cd26
parent6d262e5fedd189f2c29d4ca0cbc2071dba9e1172 (diff)
downloadpttbbs-2f6b7f7d6735ef07831dd81c6f7db7646e525493.tar
pttbbs-2f6b7f7d6735ef07831dd81c6f7db7646e525493.tar.gz
pttbbs-2f6b7f7d6735ef07831dd81c6f7db7646e525493.tar.bz2
pttbbs-2f6b7f7d6735ef07831dd81c6f7db7646e525493.tar.lz
pttbbs-2f6b7f7d6735ef07831dd81c6f7db7646e525493.tar.xz
pttbbs-2f6b7f7d6735ef07831dd81c6f7db7646e525493.tar.zst
pttbbs-2f6b7f7d6735ef07831dd81c6f7db7646e525493.zip
Crash when calling angel, fix r3038
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3043 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/talk.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index 920035e8..ae889028 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -3268,22 +3268,22 @@ TalkToAngel(){
void
CallAngel(){
- static int entered = 0;
- void *screen0;
- int x, y;
+ static int entered = 0;
+ screen_backup_t old_screen;
+ int x, y;
if (!HasUserPerm(PERM_LOGINOK) || entered)
return;
entered = 1;
getyx(&y, &x);
- screen0=malloc(screen_backupsize(t_lines, big_picture));
- screen_backup(t_lines, big_picture, screen0);
+ old_screen.raw_memory = malloc(screen_backupsize(t_lines, big_picture));
+ screen_backup(t_lines, big_picture, &old_screen);
TalkToAngel();
- screen_restore(t_lines, big_picture, screen0);
- free(screen0);
+ screen_restore(t_lines, big_picture, &old_screen);
+ free(old_screen.raw_memory);
move(y, x);
redoscr();