From: Nathan Bryant Date: Tue, 13 Apr 1999 20:26:46 +0000 (+0000) Subject: fixed time_t handling (have to cast it to long for printf/scanf) X-Git-Tag: v7.86~7760 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=2c14b633b91a1cd255a1fbab17146f873ce94b4b;p=citadel.git fixed time_t handling (have to cast it to long for printf/scanf) --- diff --git a/citadel/aidepost.c b/citadel/aidepost.c index c231f6ff0..cd5599a71 100644 --- a/citadel/aidepost.c +++ b/citadel/aidepost.c @@ -24,7 +24,7 @@ void make_message(FILE *fp) putc(1, fp); fprintf(fp, "Proom_aide"); putc(0, fp); - fprintf(fp, "T%ld", now); + fprintf(fp, "T%ld", (long)now); putc(0, fp); fprintf(fp, "ACitadel"); putc(0, fp); diff --git a/citadel/citmail.c b/citadel/citmail.c index 9f179352f..be68dff2f 100644 --- a/citadel/citmail.c +++ b/citadel/citmail.c @@ -446,7 +446,7 @@ void do_citmail(char recp[], int dtype) /* Origination */ fprintf(temp, "P%s@%s%c", userbuf, nodebuf, 0); - fprintf(temp, "T%ld%c", now, 0); + fprintf(temp, "T%ld%c", (long)now, 0); fprintf(temp, "A%s%c", userbuf, 0); /* Destination */ diff --git a/citadel/file_ops.c b/citadel/file_ops.c index d38d4f272..3ebde6db6 100644 --- a/citadel/file_ops.c +++ b/citadel/file_ops.c @@ -204,7 +204,7 @@ void cmd_netf(char *cmdbuf) putc(0,ofp); fprintf(ofp,"Pcit%ld",CC->usersupp.usernum); putc(0,ofp); time(&now); - fprintf(ofp,"T%ld",now); putc(0,ofp); + fprintf(ofp,"T%ld",(long)now); putc(0,ofp); fprintf(ofp,"A%s",CC->usersupp.fullname); putc(0,ofp); fprintf(ofp,"O%s",CC->quickroom.QRname); putc(0,ofp); fprintf(ofp,"N%s",NODENAME); putc(0,ofp); @@ -555,7 +555,7 @@ void cmd_ucls(char *cmd) putc(MES_NORMAL,fp); putc(0,fp); fprintf(fp,"Pcit%ld",CC->usersupp.usernum); putc(0,fp); - fprintf(fp,"T%ld",now); putc(0,fp); + fprintf(fp,"T%ld",(long)now); putc(0,fp); fprintf(fp,"A%s",CC->curr_user); putc(0,fp); fprintf(fp,"O%s",CC->quickroom.QRname); putc(0,fp); fprintf(fp,"N%s",NODENAME); putc(0,fp); putc('M',fp); diff --git a/citadel/logging.c b/citadel/logging.c index a90228765..2b29a6bdf 100644 --- a/citadel/logging.c +++ b/citadel/logging.c @@ -28,6 +28,6 @@ void rec_log(unsigned int lrtype, char *name) { time(&now); fp = fopen("citadel.log", "a"); - fprintf(fp, "%ld|%u|%s\n", now, lrtype, name); + fprintf(fp, "%ld|%u|%s\n", (long)now, lrtype, name); fclose(fp); } diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 997be2f35..da663996e 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -995,7 +995,7 @@ void aide_message(char *text) fp=fopen(CC->temp,"wb"); fprintf(fp,"%c%c%c",255,MES_NORMAL,0); fprintf(fp,"Psysop%c",0); - fprintf(fp,"T%ld%c", time(NULL), 0); + fprintf(fp,"T%ld%c", (long)time(NULL), 0); fprintf(fp,"ACitadel%c",0); fprintf(fp,"OAide%c",0); fprintf(fp,"N%s%c",NODENAME,0); @@ -1055,7 +1055,7 @@ void make_message( putc(type,fp); /* Normal or anonymous, see MES_ flags */ putc(format_type,fp); /* Formatted or unformatted */ fprintf(fp,"Pcit%ld%c",author->usernum,0); /* path */ - fprintf(fp,"T%ld%c",now,0); /* date/time */ + fprintf(fp,"T%ld%c",(long)now,0); /* date/time */ if (fake_name[0]) fprintf(fp,"A%s%c",fake_name,0); else diff --git a/citadel/netmailer.c b/citadel/netmailer.c index 2cdde2e89..42da180be 100644 --- a/citadel/netmailer.c +++ b/citadel/netmailer.c @@ -251,7 +251,7 @@ int main(int argc, char **argv) fprintf(rmail,"To: %s\n", rbuf); time(&now); fprintf(rmail,"Date: %s", asctime(localtime(&now))); - fprintf(rmail,"Message-Id: <%ld@%s>\n", mid_buf, nbuf); + fprintf(rmail,"Message-Id: <%ld@%s>\n", (long)mid_buf, nbuf); fprintf(rmail,"X-Mailer: %s\n", CITADEL); fprintf(rmail,"Subject: %s\n", subject); fprintf(rmail,"\n"); diff --git a/citadel/netproc.c b/citadel/netproc.c index 5ad33c848..59c2ebcd7 100644 --- a/citadel/netproc.c +++ b/citadel/netproc.c @@ -160,7 +160,9 @@ int load_syslist(void) { strcpy(slist->s_nexthop,&buf[4]); } else if ( (insys==1) && (!strncmp(buf,"lastcontact",11)) ) { - sscanf(&buf[12],"%ld",&slist->s_lastcontact); + long foo; + sscanf(&buf[12],"%ld",&foo); + slist->s_lastcontact = foo; } else if ( (insys==1) && (!strncmp(buf,"humannode",9)) ) { strcpy(slist->s_humannode,&buf[10]); @@ -245,7 +247,7 @@ void rewrite_syslist(void) { fprintf(newfp,"humannode %s\n",stemp->s_humannode); if (stemp->s_lastcontact > 0L) fprintf(newfp,"lastcontact %ld %s", - stemp->s_lastcontact, + (long)stemp->s_lastcontact, asctime(localtime(&stemp->s_lastcontact))); fprintf(newfp,"\n"); } @@ -615,7 +617,7 @@ void bounce(struct minfo *bminfo) fprintf(bounce,"%c%c%c",0xFF,MES_NORMAL,0); fprintf(bounce,"Ppostmaster%c",0); - fprintf(bounce,"T%ld%c",now,0); + fprintf(bounce,"T%ld%c",(long)now,0); fprintf(bounce,"APostmaster%c",0); fprintf(bounce,"OMail%c",0); fprintf(bounce,"N%s%c",config.c_nodename,0); diff --git a/citadel/rcit.c b/citadel/rcit.c index 34a66ce97..81dec46fa 100644 --- a/citadel/rcit.c +++ b/citadel/rcit.c @@ -200,7 +200,7 @@ C: if ((author[0]==0)||(room[0]==0)||(node[0]==0)) goto ABORT; fprintf(mout,"I%ld",mid); putc(0,mout); fprintf(mout,"P%s",path); putc(0,mout); - fprintf(mout,"T%ld",now); putc(0,mout); + fprintf(mout,"T%ld",(long)now); putc(0,mout); fprintf(mout,"A%s",author); putc(0,mout); strcpy(ccc,room); rnewsxref(room,ccc); diff --git a/citadel/routines.c b/citadel/routines.c index 8a0790923..5bee93e9c 100644 --- a/citadel/routines.c +++ b/citadel/routines.c @@ -146,7 +146,7 @@ void edituser(void) sprintf(buf, "ASUP %s|%s|%d|%d|%d|%d|%ld|%ld|%d", who, pass, flags, timescalled, posted, axlevel, usernum, - lastcall, userpurge); + (long)lastcall, userpurge); serv_puts(buf); serv_gets(buf); if (buf[0]!='2') { diff --git a/citadel/serv_upgrade.c b/citadel/serv_upgrade.c index 6deda7724..536dca5e8 100644 --- a/citadel/serv_upgrade.c +++ b/citadel/serv_upgrade.c @@ -543,12 +543,12 @@ void export_a_room(struct quickroom *qr) { fprintf(exfp, "qrpasswd%c%s%c", 0, qr->QRpasswd, 0); fprintf(exfp, "qrroomaide%c%ld%c", 0, qr->QRroomaide, 0); fprintf(exfp, "qrhighest%c%ld%c", 0, qr->QRhighest, 0); - fprintf(exfp, "qrgen%c%ld%c", 0, qr->QRgen, 0); + fprintf(exfp, "qrgen%c%ld%c", 0, (long)qr->QRgen, 0); fprintf(exfp, "qrflags%c%d%c", 0, qr->QRflags, 0); fprintf(exfp, "qrdirname%c%s%c", 0, qr->QRdirname, 0); fprintf(exfp, "qrinfo%c%ld%c", 0, qr->QRinfo, 0); fprintf(exfp, "qrfloor%c%d%c", 0, qr->QRfloor, 0); - fprintf(exfp, "qrmtime%c%ld%c", 0, qr->QRmtime, 0); + fprintf(exfp, "qrmtime%c%ld%c", 0, (long)qr->QRmtime, 0); fprintf(exfp, "qrepmode%c%d%c", 0, qr->QRep.expire_mode, 0); fprintf(exfp, "qrepvalue%c%d%c", 0, qr->QRep.expire_value, 0); @@ -609,7 +609,7 @@ void export_a_user(struct usersupp *us) { fprintf(exfp, "usscreenwidth%c%d%c", 0, us->USscreenwidth, 0); fprintf(exfp, "usscreenheight%c%d%c", 0, us->USscreenheight, 0); fprintf(exfp, "usernum%c%ld%c", 0, us->usernum, 0); - fprintf(exfp, "lastcall%c%ld%c", 0, us->lastcall, 0); + fprintf(exfp, "lastcall%c%ld%c", 0, (long)us->lastcall, 0); fprintf(exfp, "usname%c%s%c", 0, us->USname, 0); fprintf(exfp, "usaddr%c%s%c", 0, us->USaddr, 0); fprintf(exfp, "uscity%c%s%c", 0, us->UScity, 0);