summaryrefslogtreecommitdiffstats
path: root/innbbsd
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-07 00:48:08 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-07 00:48:08 +0800
commit31608b78029a559ff1de6aa1188318c79c76f698 (patch)
tree0938b2d40ba1853dd775f758a6c476f53fa1144a /innbbsd
parent3a374a93478bb790ccd98afd6fc17e752d235746 (diff)
downloadpttbbs-31608b78029a559ff1de6aa1188318c79c76f698.tar
pttbbs-31608b78029a559ff1de6aa1188318c79c76f698.tar.gz
pttbbs-31608b78029a559ff1de6aa1188318c79c76f698.tar.bz2
pttbbs-31608b78029a559ff1de6aa1188318c79c76f698.tar.lz
pttbbs-31608b78029a559ff1de6aa1188318c79c76f698.tar.xz
pttbbs-31608b78029a559ff1de6aa1188318c79c76f698.tar.zst
pttbbs-31608b78029a559ff1de6aa1188318c79c76f698.zip
- fix compile warnings
- str_decode_M3: Assume output size is shorter than input size. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4501 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'innbbsd')
-rw-r--r--innbbsd/bbslink.c13
-rw-r--r--innbbsd/bbsnnrp.c12
-rw-r--r--innbbsd/connectsock.c3
-rw-r--r--innbbsd/dbz.c2
-rw-r--r--innbbsd/externs.h4
-rw-r--r--innbbsd/innbbsd.c11
-rw-r--r--innbbsd/receive_article.c2
7 files changed, 18 insertions, 29 deletions
diff --git a/innbbsd/bbslink.c b/innbbsd/bbslink.c
index 55dac2e6..0c1e6b04 100644
--- a/innbbsd/bbslink.c
+++ b/innbbsd/bbslink.c
@@ -195,7 +195,7 @@ bbslink_get_lock(file)
strncpy(LockFile, (char *)fileglue("%s.LOCK", file), sizeof LockFile);
if ((lockfd = open(LockFile, O_RDONLY)) >= 0) {
char buf[10];
- int pid;
+ int pid = -1;
if (read(lockfd, buf, sizeof buf) > 0 &&
(pid = atoi(buf)) > 0 && kill(pid, 0) == 0) {
@@ -336,7 +336,8 @@ read_article(lover, filename, userid)
void
save_outgoing(sover, filename, userid, poster, mtime)
- soverview_t *sover, *filename, *userid, *poster;
+ soverview_t *sover;
+ char *filename, *userid, *poster;
time_t mtime;
{
newsfeeds_t *nf;
@@ -387,7 +388,7 @@ save_outgoing(sover, filename, userid, poster, mtime)
}
if (nl->feedfp != NULL) {
flock(fileno(nl->feedfp), LOCK_EX);
- fprintf(nl->feedfp, "%s\t%s\t%s\t%ld\t%s\t%s\n", sover->board, filename, group, mtime, FROM, sover->subject);
+ fprintf(nl->feedfp, "%s\t%s\t%s\t%ld\t%s\t%s\n", sover->board, filename, group, (long)mtime, FROM, sover->subject);
fflush(nl->feedfp);
flock(fileno(nl->feedfp), LOCK_UN);
}
@@ -533,7 +534,7 @@ hash_value(str)
/* process_cancel() save_outgoing() hash_value(); baseN(); ascii_date(); */
-int
+static int
read_outgoing(sover)
soverview_t *sover;
{
@@ -555,7 +556,7 @@ read_outgoing(sover)
path = sover->path;
if (Verbose) {
printf("<read_outgoing> %s:%s:%s\n", board, filename, group);
- printf(" => %ld:%s\n", mtime, from);
+ printf(" => %ld:%s\n", (long)mtime, from);
printf(" => %s\n", subject);
printf(" => %s:%s\n", outgoingtype, msgid);
printf(" => %s\n", path);
@@ -574,7 +575,7 @@ read_outgoing(sover)
strncpy(MSGID_BUF, msgid, sizeof MSGID_BUF);
}
sover->msgid = MSGID;
- if ((mtime == -1) || (mtime == 4294967295)) {
+ if ((mtime == (time_t)-1)) {
static char BODY_BUF[MAXBUFLEN];
strncpy(BODY_BUF, fileglue("%s\r\n", subject), sizeof BODY_BUF);
diff --git a/innbbsd/bbsnnrp.c b/innbbsd/bbsnnrp.c
index 11c4eb69..2ecd8b77 100644
--- a/innbbsd/bbsnnrp.c
+++ b/innbbsd/bbsnnrp.c
@@ -236,8 +236,8 @@ stdinreadnews(bbsnnrp)
verboselog("Discard: %s for %s", buffer, DefaultTrustFrom);
}
} else if (strncmp(buffer, "Received: ", 10) == 0) {
- char *rptr = buffer + 10, *rrptr;
- int savech, len;
+ char *rptr = buffer + 10, *rrptr = NULL;
+ int savech = 0, len;
if (strncmp(buffer + 10, "from ", 5) == 0) {
rptr += 5;
rrptr = strchr(rptr, '(');
@@ -286,8 +286,8 @@ stdinreadnews(bbsnnrp)
static int seed;
time_t now;
time(&now);
- fprintf(tmpfp, "Message-ID: <%ld@%d.%d.%d>\r\n", now, getpid(), getuid(), seed);
- sprintf(mid, "<%ld@%d.%d.%d>", now, getpid(), getuid(), seed);
+ fprintf(tmpfp, "Message-ID: <%ld@%d.%d.%d>\r\n", (long)now, getpid(), getuid(), seed);
+ sprintf(mid, "<%ld@%d.%d.%d>", (long)now, getpid(), getuid(), seed);
seed++;
}
if (!orgmet && *DefaultOrganization) {
@@ -1074,7 +1074,7 @@ main(argc, argv)
int argc;
char **argv;
{
- char *ptr, *server, *active;
+ char *ptr, *server = NULL, *active;
int c, errflag = 0;
int lockfd;
char *inputtype;
@@ -1180,7 +1180,7 @@ main(argc, argv)
strncpy(LockFile, (char *)fileglue("%s.lock", active), sizeof(LockFile));
if ((lockfd = open(LockFile, O_RDONLY)) >= 0) {
char buf[10];
- int pid;
+ int pid = 0;
if (read(lockfd, buf, sizeof(buf)) > 0 && (pid = atoi(buf)) > 0 && kill(pid, 0) == 0) {
fprintf(stderr, "another process [%d] running\n", pid);
diff --git a/innbbsd/connectsock.c b/innbbsd/connectsock.c
index 2340eaea..0dd32b03 100644
--- a/innbbsd/connectsock.c
+++ b/innbbsd/connectsock.c
@@ -295,7 +295,8 @@ int
tryaccept(s)
int s;
{
- int ns, fromlen;
+ int ns;
+ socklen_t fromlen;
struct sockaddr sockaddr; /* Internet endpoint address */
fromlen = sizeof(struct sockaddr_in);
diff --git a/innbbsd/dbz.c b/innbbsd/dbz.c
index 717c291a..08b038e3 100644
--- a/innbbsd/dbz.c
+++ b/innbbsd/dbz.c
@@ -986,7 +986,7 @@ fetch(key)
buffer[keysize] = '\0'; /* terminated for DEBUG */
(void)mapcase(buffer, buffer, keysize);
DEBUG(("fetch: buffer (%s) looking for (%s) size = %ld\n",
- buffer, key.dptr, keysize));
+ buffer, key.dptr, (long)keysize));
if (memcmp((POINTER) key.dptr, (POINTER) buffer, cmplen) == 0 &&
(*sepp == conf.fieldsep || *sepp == '\0')) {
/* we found it */
diff --git a/innbbsd/externs.h b/innbbsd/externs.h
index de0fd84f..f16e0dd0 100644
--- a/innbbsd/externs.h
+++ b/innbbsd/externs.h
@@ -33,10 +33,6 @@ char **BNGsplit(char *);
/* rfc931.c */
char *my_rfc931_name(int, struct sockaddr_in *);
-/* strdecode.c */
-int isreturn(unsigned char);
-void str_decode_M3(unsigned char *str);
-
/* inntobbs.c */
int headervalue(char *);
void init_echomailfp(void);
diff --git a/innbbsd/innbbsd.c b/innbbsd/innbbsd.c
index 22979b1e..fee32aba 100644
--- a/innbbsd/innbbsd.c
+++ b/innbbsd/innbbsd.c
@@ -213,15 +213,6 @@ join(lineptr, pat, num)
#endif
-static int
-CMDtnrpd(client)
- ClientType *client;
-{
- argv_t *argv = &client->Argv;
- fprintf(argv->out, "%d %s\n", argv->dc->usage);
- return 0;
-}
-
int
islocalconnect(client)
ClientType *client;
@@ -273,7 +264,7 @@ CMDmode(client)
extern ClientType INNBBSD_STAT;
daemoncmd_t *p = argv->dc;
time_t uptime, now;
- int i, j;
+ int i, j = 0;
time_t lasthist;
ClientType *client1 = &INNBBSD_STAT;
diff --git a/innbbsd/receive_article.c b/innbbsd/receive_article.c
index 28d2a4aa..becdda61 100644
--- a/innbbsd/receive_article.c
+++ b/innbbsd/receive_article.c
@@ -739,7 +739,7 @@ post_article(homepath, userid, board, writebody, pathname, firstpath)
now = time(NULL);
while (1) {
- sprintf(name, "M.%ld.A", ++now);
+ sprintf(name, "M.%ld.A", (long)++now);
sprintf(article, "%s/%s", homepath, name);
fh = open(article, O_CREAT | O_EXCL | O_WRONLY, 0644);
if (fh >= 0)