Fixed compiler warnings while building the BBS. Thanks to Ken Bowley for the

patches.
This commit is contained in:
Andrew Leary 2016-09-29 04:55:12 -04:00
parent f7401d92d0
commit b6e58185cd
42 changed files with 93 additions and 83 deletions

View File

@ -1,3 +1,8 @@
v1.0.6.9 28-Sep-2016 - Andrew Leary
1. Fixed compiler warnings while building the BBS. Thanks to
Ken Bowley for the patches.
v1.0.6.8 20-Jul-2016 - Andrew Leary
1. Fixed the SETUP.sh script to handle installing on fresh

View File

@ -148,7 +148,9 @@ dist tar: ${TARFILE}
clean:
rm -f .filelist core ${TARFILE} paths.h config.h
rm -f FILE_ID.DIZ INSTALL config.log config.status stamp-h
for d in ${SUBDIRS}; do (cd $$d && ${MAKE} $@) || exit; done;
rm -f Makefile.global
${TARFILE}: .filelist
cd ..; ln -s ${PACKAGE} ${PACKAGE}-${VERSION} ; rm -f ${TARFILE}; \

6
configure vendored
View File

@ -2309,10 +2309,10 @@ SUBDIRS="lib mbcico mbfido mbmon mbsebbs mbutils mbnntp mbtask mbsetup unix lang
PACKAGE="mbsebbs"
MAJOR="1"
MINOR="0"
REVISION="6.8"
REVISION="6.9"
VERSION="$MAJOR.$MINOR.$REVISION"
COPYRIGHT="Copyright (C) 1997-2016 Michiel Broek, All Rights Reserved"
SHORTRIGHT="Copyright (C) 1997-2016 M. Broek"
COPYRIGHT="Copyright (C) 1997-2016 MBSE Development Team, All Rights Reserved"
SHORTRIGHT="Copyright (C) 1997-2016 MBSE DevTm"
GROUP="bbs"
OWNER="mbse"
ROWNER="`id -un root`"

View File

@ -12,10 +12,10 @@ AC_SUBST(SUBDIRS)
PACKAGE="mbsebbs"
MAJOR="1"
MINOR="0"
REVISION="6.8"
REVISION="6.9"
VERSION="$MAJOR.$MINOR.$REVISION"
COPYRIGHT="Copyright (C) 1997-2016 Michiel Broek, All Rights Reserved"
SHORTRIGHT="Copyright (C) 1997-2016 M. Broek"
COPYRIGHT="Copyright (C) 1997-2016 MBSE Development Team, All Rights Reserved"
SHORTRIGHT="Copyright (C) 1997-2016 MBSE DevTm"
GROUP="bbs"
OWNER="mbse"
ROWNER="`id -un root`"

View File

@ -115,6 +115,7 @@ install:
clean:
rm -f filelist
rm -f basic.html index.html upgrade.html
filelist: Makefile
BASE=`pwd`; \

View File

@ -619,7 +619,7 @@ char *printable(char *s, int l)
case '\b': *p++='\\'; *p++='b'; break;
default: snprintf(p, 5, "\\%02x", (*s & 0xff)); p+=3; break;
}
s++;
s++;
}
*p='\0';
return pbuff;

View File

@ -594,7 +594,7 @@ fidoaddr *faddr2fido(faddr *aka)
fidoaddr *Sys;
Sys = (fidoaddr *)malloc(sizeof(fidoaddr));
memset(Sys, 0, sizeof(Sys));
memset(Sys, 0, sizeof(*Sys));
Sys->zone = aka->zone;
Sys->net = aka->net;
Sys->node = aka->node;

View File

@ -245,7 +245,7 @@ void html_massage(char *inbuf, char *outbuf, size_t size)
char *inptr = inbuf;
char *outptr = outbuf;
memset(outbuf, 0, sizeof(outbuf));
memset(outbuf, 0, sizeof(*outbuf));
while (*inptr) {

View File

@ -518,8 +518,8 @@ char *Fgets(char *l, int size, FILE *f) {
eol = TRUE;
break;
} else
cr = (c=='\r');
if ( cr )
cr = (c=='\r');
if ( cr )
continue;
--size;
if (c=='\n') { eol = TRUE; break; }

View File

@ -862,7 +862,7 @@ node *getnlent(faddr *addr)
* Parse the IP flag for a optional port number.
*/
if ((r = strrchr(p, ':'))) {
*r++;
r++;
for (tmps = &nl_service; *tmps; tmps=&((*tmps)->next)) {
if (strncmp(p, (*tmps)->flag, 3) == 0) {
/*

View File

@ -88,7 +88,7 @@ int rearc(char *filename, char *arctype, int do_quiet)
newname = calloc(PATH_MAX, sizeof(char));
strcpy(newname, filename);
p = strrchr(newname, '.');
*p++;
p++;
*p = '\0';
if (!getarchiver(arctype)) {

View File

@ -161,7 +161,7 @@ int clam_stream_check(char *servname, char *servport, char *filename)
/* fwrite(buf, 1, buf_len, stderr); */
buf_c = buf + buf_len;
while(*buf_c=='\r' || *buf_c == '\r' || *buf_c == ' ')
*buf_c --;
buf_c --;
if (buf_c - buf >= sizeof(" FOUND") && strncasecmp(buf_c - sizeof(" FOUND"), " FOUND", sizeof(" FOUND")-1) == 0) {
char *buf_s = buf;
buf_c -= sizeof(" FOUND");

View File

@ -175,7 +175,7 @@ char *mkemsidat(int caller)
p=xstrcat(p,(char *)"ZAP,");
if (emsi_local_protos & PROT_ZMO)
p=xstrcat(p,(char *)"ZMO,");
if (emsi_local_protos & PROT_DZA);
if (emsi_local_protos & PROT_DZA)
p=xstrcat(p,(char *)"DZA,");
if (emsi_local_protos & PROT_KER)
p=xstrcat(p,(char *)"KER,");

View File

@ -491,9 +491,9 @@ file_list *create_filelist(fa_list *al, char *fl, int create)
}
for (tmpf = st; tmpf; tmpf = tmpf->next)
Syslog('o',"flist: \"%s\" -> \"%s\" dsp:%d flofp:%u floff:%u",
Syslog('o',"flist: \"%s\" -> \"%s\" dsp:%d flofp:%p floff:%p",
MBSE_SS(tmpf->local), MBSE_SS(tmpf->remote), tmpf->disposition,
(unsigned int)tmpf->flofp, (unsigned int)tmpf->floff);
tmpf->flofp, tmpf->floff);
return st;
}

View File

@ -241,7 +241,7 @@ SM_STATE(send_mail)
tmpfl = tosend;
tosend = request;
for (; request->next; request = request->next);
request->next = tmpfl;
request->next = tmpfl;
request = NULL;
}

View File

@ -1807,7 +1807,7 @@ int hydra(int role)
tmpfl = tosend;
tosend = request;
for (; request->next; request = request->next);
request->next = tmpfl;
request->next = tmpfl;
request = NULL;
}
@ -1823,7 +1823,7 @@ int hydra(int role)
if (emsi_remote_lcodes & LCODE_RH1) {
for (tmpfl = tosend; tmpfl->next; tmpfl = tmpfl->next);
tmpfl->next = respond;
tmpfl->next = respond;
rc = hydra_batch(role, tosend);
tmpfl->next = NULL; /* split filelist into tosend and respond again */

View File

@ -312,8 +312,8 @@ int main(int argc, char *argv[])
if (execl(temp, "mblogin", (char *)NULL) == -1)
perror("FATAL: Error loading BBS!");
InitClient(pw->pw_name, (char *)"mbcico", CFG.location, CFG.logfile,
CFG.cico_loglevel, CFG.error_log, CFG.mgrlog, CFG.debuglog);
InitClient(pw->pw_name, (char *)"mbcico", CFG.location, CFG.logfile,
CFG.cico_loglevel, CFG.error_log, CFG.mgrlog, CFG.debuglog);
/*
* If this happens, nothing is logged!
*/

View File

@ -388,8 +388,8 @@ int each(faddr *addr, char flavor, int isflo, char *fname)
if (*p == '\\')
*p='/';
for (p = buf; *p && isspace(*p); p++);
if (*p == '~')
continue;
if (*p == '~')
continue;
if ((*p == '#') || (*p == '-') || (*p == '^') || (*p == '@') || (*p == '~'))
p++;
if (stat(p, &st) != 0) {

View File

@ -73,7 +73,7 @@ int rxtcp(void)
if ((rc=tcprcvfiles()) == 0) {
if ((emsi_local_opts & OPT_NRQ) == 0) {
for (tmpfl = &tosend; *tmpfl; tmpfl = &((*tmpfl)->next));
*tmpfl = respond_wazoo();
*tmpfl = respond_wazoo();
}
if ((tosend != NULL) || ((emsi_remote_lcodes & LCODE_NPU) == 0))

View File

@ -305,7 +305,7 @@ void Send(int newsmode, char *outstr)
int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int flags, FILE *pkt)
{
int rrq, result = 1, waskludge = FALSE, badkludge;
int bNeedToGetAddressFromMsgid = (int)NULL, newsmode = 0, lines, pass, count, first;
int bNeedToGetAddressFromMsgid = 0, newsmode = 0, lines, pass, count, first;
char *newsgroup = NULL, *charset = NULL;
char *temp, *p, *q, *r, *l, *b, *To = NULL, buf[4096], c, MailFrom[128], MailTo[128];
time_t now;

View File

@ -202,7 +202,7 @@ void editor_configs(void)
for (i = 1; i < 40; i++)
if (CFG.akavalid[i])
fprintf(fp, "AKA %s\n", aka2str(CFG.aka[i]));
fprintf(fp, "\n");
fprintf(fp, "\n");
gold_akamatch(fp);
fprintf(fp, "; JAM MessageBase Setup\n;\n");

View File

@ -444,8 +444,8 @@ int compile(char *nlname, unsigned short zo, unsigned short ne, unsigned short n
*/
if ((*(buf+strlen(buf) -1) != '\n') && (*(buf + strlen(buf) -1) != '\012')) {
while (fgets(buf, sizeof(buf) -1, nl) && (*(buf + strlen(buf) -1) != '\n')) /*void*/;
if (strlen(buf) > 1) /* Suppress EOF character */
Syslog('-', "Nodelist: too long line junked (%d)", lineno);
if (strlen(buf) > 1) /* Suppress EOF character */
Syslog('-', "Nodelist: too long line junked (%d)", lineno);
continue;
}

View File

@ -69,7 +69,7 @@ void MacroRead(FILE *fi, FILE *fp)
/*
* Empty lines are just written
*/
fprintf(fp, "\r");
fprintf(fp, "\n");
} else {
strncpy(temp, ParseMacro(line,&res), 254);
if (res)
@ -78,7 +78,7 @@ void MacroRead(FILE *fi, FILE *fp)
* Only output if something was evaluated
*/
if (strlen(temp))
fprintf(fp, "%s\r", temp);
fprintf(fp, "%s\n", temp);
}
}
}

View File

@ -373,8 +373,8 @@ int rfc2ftn(FILE *fp, faddr *recipient)
fprintf(ofp, "\001TOPT %d\n", fmsg->to->point);
if (fmsg->from->point != 0)
fprintf(ofp, "\001FMPT %d\n", fmsg->from->point);
fprintf(ofp, "\001INTL %d:%d/%d %d:%d/%d\n", fmsg->to->zone, fmsg->to->net, fmsg->to->node,
fmsg->from->zone, fmsg->from->net, fmsg->from->node);
fprintf(ofp, "\001INTL %d:%d/%d %d:%d/%d\n", fmsg->to->zone, fmsg->to->net, fmsg->to->node,
fmsg->from->zone, fmsg->from->net, fmsg->from->node);
}
if ((fmsg->msgid_a == NULL) || (fmsg->msgid_n == 0)) {
@ -673,10 +673,10 @@ int rfc2ftn(FILE *fp, faddr *recipient)
for (tmp = msg; tmp; tmp = tmp->next)
if (!strcasecmp(tmp->key,"X-FTN-PATH"))
fill_path(&ptl,tmp->val);
if (msgs.Aka.point == 0) {
snprintf(sbe,128,"%u/%u",msgs.Aka.net, msgs.Aka.node);
fill_path(&ptl,sbe);
}
if (msgs.Aka.point == 0) {
snprintf(sbe,128,"%u/%u",msgs.Aka.net, msgs.Aka.node);
fill_path(&ptl,sbe);
}
/*
* Only add PATH line if there is something

View File

@ -463,9 +463,9 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to)
} else
if (*(l=p+strlen(p)-1) == '\n')
*l='\0';
for (l=p+strlen(p)-1;*l == ' ';l--)
*l='\0';
orig = xstrcpy(p);
for (l=p+strlen(p)-1;*l == ' ';l--)
*l='\0';
orig = xstrcpy(p);
}
}

View File

@ -89,7 +89,7 @@ void ParseMask(char *s, fidoaddr *addr)
else
if (strcmp(str, "All"))
good = FALSE;
str = p;
str = p;
}
if ((p=strchr(str, '.'))) {
@ -101,7 +101,7 @@ void ParseMask(char *s, fidoaddr *addr)
addr->node = 65535;
else
good = FALSE;
str = p;
str = p;
} else {
if (strspn(str, "0123456789") == strlen(str))
addr->node = atoi(str);
@ -110,7 +110,7 @@ void ParseMask(char *s, fidoaddr *addr)
addr->node = 65535;
else
good = FALSE;
str = NULL;
str = NULL;
}
if (str) {

View File

@ -406,7 +406,7 @@ int get_post(char *buf, int max)
int c, len;
len = 0;
memset(buf, 0, sizeof(buf));
memset(buf, 0, sizeof(*buf));
while (TRUE) {
c = tty_getc(180);
if (c <= 0) {

View File

@ -263,7 +263,7 @@ int get_nntp(char *buf, int max)
int c, len;
len = 0;
memset(buf, 0, sizeof(buf));
memset(buf, 0, sizeof(*buf));
while (TRUE) {
c = tty_getc(180);
if (c <= 0) {

View File

@ -652,10 +652,10 @@ int rfc2ftn(FILE *fp)
for (tmp = msg; tmp; tmp = tmp->next)
if (!strcasecmp(tmp->key,"X-FTN-PATH"))
fill_path(&ptl,tmp->val);
if (msgs.Aka.point == 0) {
snprintf(sbe,16,"%u/%u",msgs.Aka.net, msgs.Aka.node);
fill_path(&ptl,sbe);
}
if (msgs.Aka.point == 0) {
snprintf(sbe,16,"%u/%u",msgs.Aka.net, msgs.Aka.node);
fill_path(&ptl,sbe);
}
/*
* Only add PATH line if there is something

View File

@ -1042,7 +1042,7 @@ void Choose_Mailbox(char *Option)
SetEmailArea((char *)"trash");
else if (!strcmp(sMailbox, "trash"))
SetEmailArea((char *)"archive");
else if (!strcmp(sMailbox, "archive"));
else if (!strcmp(sMailbox, "archive"))
SetEmailArea((char *)"mailbox");
}
Syslog('+', "Emailarea: %s", sMailbox);

View File

@ -328,7 +328,7 @@ void DoMenu(int Type)
case 7:
/* Run external program */
if (strlen(menus.DoorName) && !menus.HideDoor) {
memset(temp, 0, sizeof(temp));
memset(temp, 0, sizeof(*temp));
strcpy(temp, menus.DoorName);
ExtDoor(menus.OptionalData, menus.NoDoorsys, menus.Y2Kdoorsys, menus.Comport,
menus.NoSuid, menus.NoPrompt, menus.SingleUser, temp);

View File

@ -892,28 +892,28 @@ void MsgGlobal(void)
Found = TRUE;
break;
}
if (Found)
break;
fseek(tfil, 0, SEEK_SET);
while (fread(&Sc, sizeof(sysconnect), 1, tfil) == 1) {
if (Sc.aka.zone == 0) {
fseek(tfil, - sizeof(sysconnect), SEEK_CUR);
memset(&Sc, 0, sizeof(sysconnect));
Sc.aka.zone = a2.zone;
Sc.aka.net = a2.net;
Sc.aka.node = a2.node;
Sc.aka.point = a2.point;
Sc.sendto = TRUE;
Sc.receivefrom = TRUE;
snprintf(Sc.aka.domain, 13, "%s", a2.domain);
fwrite(&Sc, sizeof(sysconnect), 1, tfil);
if (SaveMsgRec(marea, FALSE) == 0) {
Done++;
Syslog('+', "Added %s to area %s", aka2str(a2), msgs.Tag);
}
break;
if (Found)
break;
fseek(tfil, 0, SEEK_SET);
while (fread(&Sc, sizeof(sysconnect), 1, tfil) == 1) {
if (Sc.aka.zone == 0) {
fseek(tfil, - sizeof(sysconnect), SEEK_CUR);
memset(&Sc, 0, sizeof(sysconnect));
Sc.aka.zone = a2.zone;
Sc.aka.net = a2.net;
Sc.aka.node = a2.node;
Sc.aka.point = a2.point;
Sc.sendto = TRUE;
Sc.receivefrom = TRUE;
snprintf(Sc.aka.domain, 13, "%s", a2.domain);
fwrite(&Sc, sizeof(sysconnect), 1, tfil);
if (SaveMsgRec(marea, FALSE) == 0) {
Done++;
Syslog('+', "Added %s to area %s", aka2str(a2), msgs.Tag);
}
break;
}
}
break;
case 3: fseek(tfil, 0, SEEK_SET);
while (fread(&Sc, sizeof(sysconnect), 1, tfil) == 1) {

View File

@ -474,7 +474,7 @@ void ImportOneline(void)
mbse_mvprintw(5, 6, "8.7.3 IMPORT ONELINERS");
set_color(CYAN, BLACK);
temp = calloc(PATH_MAX, sizeof(char));
memset(temp, 0, sizeof(temp));
memset(temp, 0, sizeof(*temp));
strcpy(temp, edit_str(21, 6,64, temp, (char *)"The ^full path and filename^ of the file to import"));
if (strlen(temp) == 0) {
free(temp);

View File

@ -117,7 +117,7 @@ static void die(int onsig)
for (i = 1; i < 40; i++)
if (CFG.akavalid[i])
fprintf(fp, "AKA %s\n", aka2str(CFG.aka[i]));
fprintf(fp, "\n");
fprintf(fp, "\n");
gold_akamatch(fp);
fprintf(fp, "; JAM MessageBase Setup\n;\n");

View File

@ -837,8 +837,8 @@ int each(faddr *addr, char flavor, int isflo, char *fname)
if (*p == '\\')
*p='/';
for (p = buf; *p && isspace(*p); p++);
if (*p == '~')
continue;
if (*p == '~')
continue;
if ((*p == '#') || (*p == '-') || (*p == '^') || (*p == '@'))
p++;
if (stat(p, &st) != 0) {

View File

@ -84,7 +84,7 @@ void fill_portlist(pp_list **fdp, pp_list *new)
pp_list *tmp, *ta;
tmp = (pp_list *)malloc(sizeof(pp_list));
memset(tmp, 0, sizeof(tmp));
memset(tmp, 0, sizeof(*tmp));
tmp->next = NULL;
strncpy(tmp->tty, new->tty, 6);
tmp->mflags = new->mflags;

View File

@ -309,7 +309,7 @@ void disk_getfs_r(char *buf)
if (ans != NULL)
free(ans);
ans = NULL;
ans = NULL;
return;
}

View File

@ -14,6 +14,7 @@ all:
clean:
rm -f core filelist Makefile.bak
rm -f editor
install:
@if [ "`id -un`" != "root" ] ; then \

View File

@ -35,11 +35,11 @@ case "$1" in
rm -f $MBSE_ROOT/var/sema/*
rm -f $MBSE_ROOT/var/*.LCK
rm -f $MBSE_ROOT/tmp/mb*
su mbse -c '$MBSE_ROOT/bin/mbtask' >/dev/null
su -m mbse -c '$MBSE_ROOT/bin/mbtask' >/dev/null
echo -n "mbtask "
sleep 2
if [ -f $MBSE_ROOT/etc/config.data ]; then
su mbse -c '$MBSE_ROOT/bin/mbstat open -quiet'
su -m mbse -c '$MBSE_ROOT/bin/mbstat open -quiet'
echo -n "opened "
fi
echo "done."
@ -48,7 +48,7 @@ case "$1" in
echo -n "Stopping $DESC: "
if [ -f $MBSE_ROOT/var/run/mbtask ]; then
echo -n "logoff users "
su mbse -c '$MBSE_ROOT/bin/mbstat close wait -quiet' >/dev/null
su -m mbse -c '$MBSE_ROOT/bin/mbstat close wait -quiet' >/dev/null
echo -n " stopping mbtask"
pid=$( cat $MBSE_ROOT/var/run/mbtask )
kill $pid

View File

@ -30,6 +30,7 @@ all: ${TARGET}
clean:
rm -f ${TARGET} *.o *.h~ *.c~ core filelist Makefile.bak
rm -f login.defs
mbuseradd: ${MBUSERADD_OBJS}
${CC} -o mbuseradd ${MBUSERADD_OBJS} ${LDFLAGS} ${LIBS}

View File

@ -85,7 +85,7 @@ void dolastlog(struct lastlog *ll, const struct passwd *pw, const char *line, co
if (ll)
*ll = newlog;
time(&newlog.ll_time);
time((time_t *) &newlog.ll_time);
strncpy(newlog.ll_line, line, sizeof newlog.ll_line);
#ifdef HAVE_LL_HOST
strncpy(newlog.ll_host, host, sizeof newlog.ll_host);

View File

@ -120,7 +120,7 @@ void checkutmp(int picky)
/* XXX - assumes /dev/tty?? */
strncpy(utent.ut_id, utent.ut_line + 3, sizeof utent.ut_id);
strcpy(utent.ut_user, "LOGIN");
time(&utent.ut_time);
time((time_t *) &utent.ut_time);
}
}
@ -294,7 +294,7 @@ void setutmp(const char *name, const char *line, const char *host)
{
utent.ut_type = USER_PROCESS;
strncpy(utent.ut_user, name, sizeof utent.ut_user);
time(&utent.ut_time);
time((time_t *) &utent.ut_time);
/* other fields already filled in by checkutmp above */
setutent();
pututline(&utent);