summaryrefslogtreecommitdiffstats
path: root/innbbsd/receive_article.c
diff options
context:
space:
mode:
authorwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-01-31 10:24:04 +0800
committerwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-01-31 10:24:04 +0800
commit5cc73c88533fc91678213ac27ff3512ceb4b3178 (patch)
tree1b847d5f4f7b560866a2a9ee11e86bfa0618885b /innbbsd/receive_article.c
parent9d5f00a692abfe6ba859ebf75c3a0138a7adde35 (diff)
downloadpttbbs-5cc73c88533fc91678213ac27ff3512ceb4b3178.tar
pttbbs-5cc73c88533fc91678213ac27ff3512ceb4b3178.tar.gz
pttbbs-5cc73c88533fc91678213ac27ff3512ceb4b3178.tar.bz2
pttbbs-5cc73c88533fc91678213ac27ff3512ceb4b3178.tar.lz
pttbbs-5cc73c88533fc91678213ac27ff3512ceb4b3178.tar.xz
pttbbs-5cc73c88533fc91678213ac27ff3512ceb4b3178.tar.zst
pttbbs-5cc73c88533fc91678213ac27ff3512ceb4b3178.zip
Fix compile warnings
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4434 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'innbbsd/receive_article.c')
-rw-r--r--innbbsd/receive_article.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/innbbsd/receive_article.c b/innbbsd/receive_article.c
index 627db083..f35fd19b 100644
--- a/innbbsd/receive_article.c
+++ b/innbbsd/receive_article.c
@@ -27,7 +27,9 @@
#include "bbs.h"
#include "externs.h"
#include <stdlib.h>
+#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE /* glibc2 needs this */
+#endif
#include <time.h>
#ifndef PowerBBS
#include "innbbsconf.h"
@@ -249,7 +251,7 @@ receive_article()
newsfeeds_t *nf;
char *boardhome;
char hispaths[4096];
- char firstpath[MAXPATHLEN], *firstpathbase;
+ char firstpath[PATHLEN], *firstpathbase;
char *lesssym, *nameptrleft, *nameptrright;
#ifdef HMM_USE_ANTI_SPAM
@@ -502,7 +504,7 @@ int
receive_control(void)
{
char *boardhome, *fname;
- char firstpath[MAXPATHLEN], *firstpathbase;
+ char firstpath[PATHLEN], *firstpathbase;
char **splitptr, *ngptr;
newsfeeds_t *nf;
@@ -544,7 +546,7 @@ cancel_article_front(msgid)
char *ptr = (char *)DBfetch(msgid);
char *filelist, filename[2048];
char histent[4096];
- char firstpath[MAXPATHLEN], *firstpathbase;
+ char firstpath[PATHLEN], *firstpathbase;
if (ptr == NULL) {
bbslog("cancel failed(DBfetch): %s\n", msgid);
return 0;
@@ -715,9 +717,9 @@ post_article(homepath, userid, board, writebody, pathname, firstpath)
{
struct fileheader_t header;
char *subject = SUBJECT;
- char index[MAXPATHLEN];
- static char name[MAXPATHLEN];
- char article[MAXPATHLEN];
+ char index[PATHLEN];
+ static char name[PATHLEN];
+ char article[PATHLEN];
FILE *fidx;
int fh, bid;
time_t now;
@@ -736,7 +738,7 @@ post_article(homepath, userid, board, writebody, pathname, firstpath)
now = time(NULL);
while (1) {
- sprintf(name, "M.%d.A", ++now);
+ sprintf(name, "M.%ld.A", ++now);
sprintf(article, "%s/%s", homepath, name);
fh = open(article, O_CREAT | O_EXCL | O_WRONLY, 0644);
if (fh >= 0)
@@ -842,13 +844,12 @@ void
cancelpost(fileheader_t * fhdr, char *boardname)
{
int fd;
- char fpath[MAXPATHLEN];
+ char fpath[PATHLEN];
sprintf(fpath, BBSHOME "/boards/%c/%s/%s", boardname[0], boardname, fhdr->filename);
if ((fd = open(fpath, O_RDONLY)) >= 0) {
fileheader_t postfile;
- char fn2[MAXPATHLEN] = BBSHOME "/boards/d/deleted",
- *junkdir;
+ char fn2[PATHLEN] = BBSHOME "/boards/d/deleted";
stampfile(fn2, &postfile);
memcpy(postfile.owner, fhdr->owner, IDLEN + TTLEN + 10);
@@ -865,10 +866,11 @@ cancelpost(fileheader_t * fhdr, char *boardname)
/* new/old/lock file processing */
/* ---------------------------- */
+#if 0
typedef struct {
- char newfn[MAXPATHLEN];
- char oldfn[MAXPATHLEN];
- char lockfn[MAXPATHLEN];
+ char newfn[PATHLEN];
+ char oldfn[PATHLEN];
+ char lockfn[PATHLEN];
} nol;
@@ -882,7 +884,6 @@ nolfilename(n, fpath)
sprintf(n->lockfn, "%s.lock", fpath);
}
-#if 0
int
delete_record(const char *fpath, int size, int id)
{
@@ -965,7 +966,7 @@ cancel_article(homepath, board, file)
{
struct fileheader_t header;
struct stat state;
- char dirname[MAXPATHLEN];
+ char dirname[PATHLEN];
long size, time, now;
int fd, lower, ent;
@@ -1033,7 +1034,7 @@ post_article(homepath, userid, board, writebody, pathname, firstpath)
READINFO readinfo;
SHORT fileid;
- char buf[MAXPATHLEN];
+ char buf[PATHLEN];
struct stat stbuf;
int fh;