summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/calendar.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mbbsd/calendar.c b/mbbsd/calendar.c
index 60cbd59a..76c899f7 100644
--- a/mbbsd/calendar.c
+++ b/mbbsd/calendar.c
@@ -330,18 +330,19 @@ calendar(void)
int getHoroscope(int m, int d)
{
- if (m > 11 || m < 0)
+ if (m > 12 || m < 1)
return 1;
- // 摩羯 水瓶 雙魚 白羊 金牛 雙子 巨蟹 獅子 處女 天秤 天蠍 射手
+ // Return: 1 .. 12
+ // 摩羯 水瓶 雙魚 牡羊 金牛 雙子 巨蟹 獅子 處女 天秤 天蠍 射手
const int firstday[12] = {
- /* Dec. */ 22, /* Jan. */ 20, 19, 21, 20, 21, 21, 23, 23, 23, 23, 22
+ /* Jan. */ 20, 19, 21, 20, 21, 21, 23, 23, 23, 23, 22, 22
};
- if (d >= firstday[m]) {
+ if (d >= firstday[m - 1]) {
if (m == 12)
return 1;
else
- return m - 1;
+ return m + 1;
}
else
return m;