summaryrefslogtreecommitdiffstats
path: root/mbbsd/chicken.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-04-29 03:35:29 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-04-29 03:35:29 +0800
commit747db9b7bed623d2d957aa14dbc6a505cf763be8 (patch)
tree479cf6940e240c6e6e2f8435e13d97f9269788c5 /mbbsd/chicken.c
parent980b8d2d2504b7299ceee845aff46c1f593e498f (diff)
downloadpttbbs-747db9b7bed623d2d957aa14dbc6a505cf763be8.tar
pttbbs-747db9b7bed623d2d957aa14dbc6a505cf763be8.tar.gz
pttbbs-747db9b7bed623d2d957aa14dbc6a505cf763be8.tar.bz2
pttbbs-747db9b7bed623d2d957aa14dbc6a505cf763be8.tar.lz
pttbbs-747db9b7bed623d2d957aa14dbc6a505cf763be8.tar.xz
pttbbs-747db9b7bed623d2d957aa14dbc6a505cf763be8.tar.zst
pttbbs-747db9b7bed623d2d957aa14dbc6a505cf763be8.zip
change getdata() constant to sizeof()
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@131 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/chicken.c')
-rw-r--r--mbbsd/chicken.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/mbbsd/chicken.c b/mbbsd/chicken.c
index f789925f..f13b68dc 100644
--- a/mbbsd/chicken.c
+++ b/mbbsd/chicken.c
@@ -1,4 +1,4 @@
-/* $Id: chicken.c,v 1.1 2002/03/07 15:13:48 in2 Exp $ */
+/* $Id: chicken.c,v 1.2 2002/04/28 19:35:29 in2 Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -137,7 +137,8 @@ static int new_chicken() {
}
vice(price,"寵物蛋");
while(strlen(mychicken->name)<3)
- getdata(8, 0, "幫牠取個好名字:", mychicken->name, 18, DOECHO);
+ getdata(8, 0, "幫牠取個好名字:", mychicken->name,
+ sizeof(mychicken->name), DOECHO);
now = time(NULL);
sprintf(buf,"\033[31m%s \033[m養了一隻叫\033[33m %s \033[m的 "
@@ -367,7 +368,8 @@ void ch_buyitem(int money, char *picture, int *item) {
int num = 0;
char buf[5];
- getdata_str(b_lines - 1, 0, "要買多少份呢:", buf, 4, DOECHO, "1");
+ getdata_str(b_lines - 1, 0, "要買多少份呢:",
+ buf, sizeof(buf), DOECHO, "1");
num = atoi(buf);
if(num < 1)
return;
@@ -414,7 +416,7 @@ static void ch_kill() {
sprintf(buf, "棄養這%s要被罰 100 元, 是否要棄養?(y/N)",
chicken_type[(int)mychicken->type]);
- getdata_str(23, 0, buf, ans, 3, DOECHO, "N");
+ getdata_str(23, 0, buf, ans, sizeof(ans), DOECHO, "N");
if(ans[0] == 'y') {
time_t now = time(NULL);
@@ -476,7 +478,7 @@ static int ch_sell() {
sprintf(buf, "這隻%d歲%s可以賣 %d 元, 是否要賣?(y/N)", age,
chicken_type[(int)mychicken->type], money);
- getdata_str(23, 0, buf, ans, 3, DOECHO, "N");
+ getdata_str(23, 0, buf, ans, sizeof(ans), DOECHO, "N");
if(ans[0]=='y') {
sprintf(buf, "\033[31m%s\033[m 把 \033[33m%s\033[m "
"\033[32m%s\033[m 用 \033[36m%d\033[m 賣了 於 %s",