Fixed compiler warnings

This commit is contained in:
Michiel Broek
2011-05-22 17:43:12 +02:00
parent ad0d7cc679
commit 517cc6944f
38 changed files with 174 additions and 210 deletions

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: mbfadopt.c,v 1.28 2008/02/17 17:50:14 mbse Exp $
* Purpose: File Database Maintenance - Adopt file
*
*****************************************************************************
* Copyright (C) 1997-2008
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -47,7 +46,7 @@ void AdoptFile(int Area, char *File, char *Description)
FILE *fp;
char *temp, *temp2, *tmpdir, *unarc, *pwd, *lname, *fileid;
char Desc[256], TDesc[256];
int IsArchive = FALSE, MustRearc = FALSE, UnPacked = FALSE;
int MustRearc = FALSE, UnPacked = FALSE;
int IsVirus = FALSE, File_Id = FALSE;
int i, j, k, lines = 0, File_id_cnt = 0;
struct FILE_record f_db;
@@ -100,7 +99,6 @@ void AdoptFile(int Area, char *File, char *Description)
}
if ((unarc = unpacker(File))) {
IsArchive = TRUE;
if (strlen(area.Archiver) && (strcmp(unarc, area.Archiver) == 0))
MustRearc = TRUE;
UnPacked = UnpackFile(temp);

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: mbmsg.c,v 1.34 2007/09/02 11:17:32 mbse Exp $
* Purpose ...............: Message Base Maintenance
*
*****************************************************************************
* Copyright (C) 1997-2007
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -423,7 +422,7 @@ void LinkArea(char *Path, int Areanr)
*/
void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, int Areanr)
{
unsigned int Number, TotalMsgs = 0, Highest, *Active, Counter = 0;
unsigned int Number, TotalMsgs = 0, *Active, Counter = 0;
int i, DelCount = 0, DelAge = 0, Done;
time_t Today, MsgDate;
@@ -455,7 +454,6 @@ void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, int Areanr)
Active = NULL;
Number = Msg_Lowest();
Highest = Msg_Highest();
do {
if (CFG.slow_util && do_quiet)

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: ptic.c,v 1.68 2008/11/26 22:12:28 mbse Exp $
* Purpose ...............: Process 1 .tic file
*
*****************************************************************************
* Copyright (C) 1997-2008
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -67,9 +66,8 @@ extern int check_dupe;
*/
int ProcessTic(fa_list **sbl, orphans **opl)
{
time_t Now;
int First, Listed = FALSE, DownLinks = 0, MustRearc = FALSE;
int UnPacked = FALSE, IsArchive = FALSE, rc, i, j, k, File_Id = FALSE;
int UnPacked = FALSE, IsArchive = FALSE, rc, i, j, k;
char *Temp, *unarc = NULL, *cmd = NULL;
char temp1[PATH_MAX], temp2[PATH_MAX], sbe[24], TDesc[1024];
unsigned int crc, crc2, Kb;
@@ -81,8 +79,6 @@ int ProcessTic(fa_list **sbl, orphans **opl)
qualify *qal = NULL, *tmpq;
orphans *topl;
Now = time(NULL);
if (TIC.TicIn.PathError) {
WriteError("Our Aka is in the path");
tic_bad++;
@@ -454,9 +450,6 @@ int ProcessTic(fa_list **sbl, orphans **opl)
Syslog('f', "Found %s", Temp);
snprintf(temp1, PATH_MAX, "%s/tmp/arc%d/%s", getenv("MBSE_ROOT"), (int)getpid(), Temp);
snprintf(temp2, PATH_MAX, "%s/tmp/FILE_ID.DIZ", getenv("MBSE_ROOT"));
if (file_cp(temp1, temp2) == 0) {
File_Id = TRUE;
}
} else {
Syslog('f', "Didn't find a FILE_ID.DIZ");
}
@@ -472,13 +465,9 @@ int ProcessTic(fa_list **sbl, orphans **opl)
snprintf(temp1, PATH_MAX, "%s/tmp", getenv("MBSE_ROOT"));
chdir(temp1);
snprintf(temp1, PATH_MAX, "%s/%s FILE_ID.DIZ", TIC.Inbound, TIC.TicIn.File);
if (execute_str(cmd, temp1, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null") == 0) {
File_Id = TRUE;
} else {
if (execute_str(cmd, temp1, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null")) {
snprintf(temp1, PATH_MAX, "%s/%s file_id.diz", TIC.Inbound, TIC.TicIn.File);
if (execute_str(cmd, temp1, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null") == 0) {
File_Id = TRUE;
}
execute_str(cmd, temp1, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null");
}
free(cmd);
}

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: rfc2ftn.c,v 1.55 2008/08/31 21:10:51 mbse Exp $
* Purpose ...............: Convert RFC to FTN
*
*****************************************************************************
* Copyright (C) 1997-2007
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -132,7 +131,7 @@ int rfc2ftn(FILE *fp, faddr *recipient)
FILE *ofp;
fa_list *sbl = NULL, *ptl = NULL, *tmpl;
faddr *ta, *fta;
unsigned int svmsgid, svreply, acup_n = 0;
unsigned int acup_n = 0;
int sot_kludge = FALSE, eot_kludge = FALSE, tinyorigin = FALSE;
int needsplit, hdrsize, datasize, splitpart, forbidsplit, rfcheaders;
time_t Now;
@@ -142,12 +141,6 @@ int rfc2ftn(FILE *fp, faddr *recipient)
if (recipient)
Syslog('m', "Recipient: %s", ascfnode(recipient, 0xff));
rewind(fp);
// Syslog('m', "========== RFC Start");
// while ((fgets(temp, 4095, fp)) != NULL) {
// Syslogp('m', printable(temp, 0));
// }
// Syslog('m', "========== RFC end");
// rewind(fp);
msg = parsrfc(fp);
newsmode = hdr((char *)"Newsgroups", msg) ?TRUE:FALSE;
@@ -175,8 +168,6 @@ int rfc2ftn(FILE *fp, faddr *recipient)
if (newsmode)
fmsg->area = xstrcpy(msgs.Tag);
svmsgid = fmsg->msgid_n;
svreply = fmsg->reply_n;
if ((p = hdr((char *)"Message-ID",msg))) {
ftnmsgid(p, &fmsg->msgid_a, &fmsg->msgid_n, fmsg->area);
hash_update_s(&fmsg->msgid_n, fmsg->area);

View File

@@ -1,11 +1,10 @@
/*****************************************************************************
*
* $Id: rnews.c,v 1.15 2005/10/11 20:49:47 mbse Exp $
* Purpose ...............: rnews function
* Remarks ...............: Most of these functions are borrowed from inn.
*
*****************************************************************************
* Copyright (C) 1997-2005
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -269,7 +268,6 @@ static int Process(char *article)
{
HEADER *hp;
char *p;
char *id = NULL;
FILE *fp;
/*
@@ -287,7 +285,6 @@ static int Process(char *article)
return FALSE;
}
if (IS_MESGID(hp)) {
id = p;
continue;
}
}

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: toberep.c,v 1.18 2005/11/12 12:52:30 mbse Exp $
* Purpose ...............: Add a file to the To-Be-Reported database
*
*****************************************************************************
* Copyright (C) 1997-2005
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -45,7 +44,7 @@ int Add_ToBeRep(struct _filerecord report)
char *fname;
struct _filerecord Temp;
FILE *tbr;
int rc, Found = FALSE;
int Found = FALSE;
fname = calloc(PATH_MAX, sizeof(char));
snprintf(fname, PATH_MAX, "%s/etc/toberep.data", getenv("MBSE_ROOT"));
@@ -67,8 +66,8 @@ int Add_ToBeRep(struct _filerecord report)
* If it's a later received file, update the record
*/
if (report.Fdate > Temp.Fdate) {
rc = fseek(tbr, - sizeof(Temp), SEEK_CUR);
rc = fwrite(&report, sizeof(Temp), 1, tbr);
fseek(tbr, - sizeof(Temp), SEEK_CUR);
fwrite(&report, sizeof(Temp), 1, tbr);
fclose(tbr);
return TRUE;
}

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: tosspkt.c,v 1.28 2006/06/05 10:12:27 mbse Exp $
* Purpose ...............: Toss a single *.pkt file
*
*****************************************************************************
* Copyright (C) 1997-2005
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -141,7 +140,7 @@ int importmsg(faddr *p_from, faddr *f, faddr *t, char *orig, char *subj, time_t
int flags, int cost, FILE *fp, unsigned int tzone)
{
char *buf, *marea = NULL;
int echomail = FALSE, rc = 0, bad = 0, Known = FALSE, FirstLine, size = 0;
int echomail = FALSE, rc = 0, bad = 0, FirstLine, size = 0;
sysconnect Link;
if (CFG.slow_util && do_quiet)
@@ -160,7 +159,6 @@ int importmsg(faddr *p_from, faddr *f, faddr *t, char *orig, char *subj, time_t
StatAdd(&nodes.MailRcvd, 1);
UpdateNode();
SearchNode(Link.aka);
Known = TRUE;
}
buf = calloc(MAX_LINE_LENGTH +1, sizeof(char));