summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-04-16 11:27:18 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-04-16 11:27:18 +0800
commit87c52669138a2f93406d7b7fae6967955c6b8ce6 (patch)
treed958b22a5b8b041ef907a31793e115b6e65cf6c8 /util
parent4ae0244c620fd1b2808eac467dcedf9455e074e1 (diff)
downloadpttbbs-87c52669138a2f93406d7b7fae6967955c6b8ce6.tar
pttbbs-87c52669138a2f93406d7b7fae6967955c6b8ce6.tar.gz
pttbbs-87c52669138a2f93406d7b7fae6967955c6b8ce6.tar.bz2
pttbbs-87c52669138a2f93406d7b7fae6967955c6b8ce6.tar.lz
pttbbs-87c52669138a2f93406d7b7fae6967955c6b8ce6.tar.xz
pttbbs-87c52669138a2f93406d7b7fae6967955c6b8ce6.tar.zst
pttbbs-87c52669138a2f93406d7b7fae6967955c6b8ce6.zip
fix util/birth.c
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3505 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r--util/Makefile4
-rw-r--r--util/birth.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/util/Makefile b/util/Makefile
index fca3d4e7..1e997e41 100644
--- a/util/Makefile
+++ b/util/Makefile
@@ -9,12 +9,12 @@ BBSBASE= ../include/var.h
UTIL_OBJS= \
util_cache.o util_record.o util_passwd.o util_var.o \
util_stuff.o util_osdep.o util_args.o util_file.o \
- util_crypt.o
+ util_crypt.o util_calendar.o
MBBSD_OBJS= \
cache record passwd var \
stuff osdep args file \
- crypt
+ crypt calendar
# 下面這些程式, 會被 compile 並且和 $(UTIL_OBJS) 聯結
CPROG_WITH_UTIL= \
diff --git a/util/birth.c b/util/birth.c
index e9198ef5..a3503390 100644
--- a/util/birth.c
+++ b/util/birth.c
@@ -60,6 +60,8 @@ int main(argc, argv)
"★★★★★★ \n\n");
fprintf(fp1, "【本日壽星】 \n");
int horoscope = getHoroscope(ptime->tm_mon + 1, ptime->tm_mday);
+ char path[PATHLEN];
+ snprintf(path, sizeof(path), BBSHOME "/etc/Welcome_birth.%d", horoscope);
for(j = 1; j <= MAX_USERS; j++) {
passwd_query(j, &user);
if (bad_user_id(NULL))
@@ -71,7 +73,7 @@ int main(argc, argv)
strcpy(mymail.owner, BBSNAME);
strcpy(mymail.title, "!! 生日快樂 !!");
unlink(genbuf);
- Link(BBSHOME "/etc/Welcome_birth.%d", genbuf, horoscope);
+ Link(path, genbuf);
sprintf(genbuf, BBSHOME "/home/%c/%s/.DIR", user.userid[0], user.userid);
append_record(genbuf, &mymail, sizeof(mymail));
if ((user.numlogins + user.numposts) < 20)