summaryrefslogtreecommitdiffstats
path: root/mbbsd/menu.c
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-13 11:20:04 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-13 11:20:04 +0800
commit6a428fb60d8ec6092d428b2e0f869a31f4890dc7 (patch)
treea0671ea2dc0168a9cb5625f867d553f6d0441efc /mbbsd/menu.c
parent438c456b95eec0e5ac662ca3cf2386dff2c44bc7 (diff)
downloadpttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.gz
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.bz2
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.lz
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.xz
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.zst
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.zip
replace time(NULL) by now
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@163 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/menu.c')
-rw-r--r--mbbsd/menu.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mbbsd/menu.c b/mbbsd/menu.c
index f65a1e89..5108606e 100644
--- a/mbbsd/menu.c
+++ b/mbbsd/menu.c
@@ -1,4 +1,4 @@
-/* $Id: menu.c,v 1.7 2002/05/08 22:31:23 in2 Exp $ */
+/* $Id: menu.c,v 1.8 2002/05/13 03:20:04 ptt Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
@@ -21,7 +21,7 @@ extern char reset_color[];
extern userinfo_t *currutmp;
extern char *BBSName;
extern int b_lines; /* Screen bottom line number: t_lines-1 */
-
+extern time_t now;
/* help & menu processring */
static int refscreen = NA;
extern char *boardprefix;
@@ -122,8 +122,8 @@ void movie(int i) {
static short history[MAX_HISTORY];
static char myweek[] = "天一二三四五六";
const char *msgs[] = {"關閉", "打開", "拔掉", "防水","好友"};
- time_t now = time(NULL);
struct tm *ptime = localtime(&now);
+ int j;
if((currstat != CLASS) && (cuser.uflag & MOVIE_FLAG) &&
!ptt->busystate && ptt->max_film > 0) {
@@ -136,8 +136,8 @@ void movie(int i) {
i = 1 + (int)(((float)ptt->max_film *
rand()) / (RAND_MAX + 1.0));
- for(now = ptt->max_history; now >= 0; now--)
- if(i == history[now]) {
+ for(j = ptt->max_history; j >= 0; j--)
+ if(i == history[j]) {
i = 0;
break;
}
@@ -145,7 +145,7 @@ void movie(int i) {
}
memcpy(history, &history[1], ptt->max_history * sizeof(short));
- history[ptt->max_history] = now = i;
+ history[ptt->max_history] = j = i;
if(i == 999) /* Goodbye my friend */
i = 0;