diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-09-21 01:18:53 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-09-21 01:18:53 +0800 |
commit | b9539de0ffa696b5f8debe2d3e91e4eab81004fa (patch) | |
tree | 0d7dcb34b8264f4e6579452ee580c41d55f5cc85 /mbbsd/cal.c | |
parent | 2b3b00dc185e362e46f93a6ad50fb4d423452551 (diff) | |
download | pttbbs-b9539de0ffa696b5f8debe2d3e91e4eab81004fa.tar pttbbs-b9539de0ffa696b5f8debe2d3e91e4eab81004fa.tar.gz pttbbs-b9539de0ffa696b5f8debe2d3e91e4eab81004fa.tar.bz2 pttbbs-b9539de0ffa696b5f8debe2d3e91e4eab81004fa.tar.lz pttbbs-b9539de0ffa696b5f8debe2d3e91e4eab81004fa.tar.xz pttbbs-b9539de0ffa696b5f8debe2d3e91e4eab81004fa.tar.zst pttbbs-b9539de0ffa696b5f8debe2d3e91e4eab81004fa.zip |
* fix bug: don't getdata() on non-local variable directly, to avoid reentrant crash.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3564 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/cal.c')
-rw-r--r-- | mbbsd/cal.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mbbsd/cal.c b/mbbsd/cal.c index 4fad13ff..faafe2b5 100644 --- a/mbbsd/cal.c +++ b/mbbsd/cal.c @@ -300,14 +300,16 @@ p_cloak(void) int p_from(void) { + char tmp_from[sizeof(currutmp->from)]; if (getans("確定要改故鄉?[y/N]") != 'y') return 0; reload_money(); if (cuser.money < 49) return 0; if (getdata_buf(b_lines - 1, 0, "請輸入新故鄉:", - currutmp->from, sizeof(currutmp->from), DOECHO)) { + tmp_from, sizeof(tmp_from), DOECHO)) { vice(49, "更改故鄉"); + strlcpy(currutmp->from, tmp_from, sizeof(currutmp->from)); currutmp->from_alias = 0; } return 0; |