summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-18 15:31:09 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-18 15:31:09 +0800
commit2502fc38a34eaf5a146e502a0e87eccfe3283ed9 (patch)
tree677e4bb5bf0dea45abf6baf48d1ad18bed46e43e
parent4c5f4c5f248509cd1e46ef308d52be1804181411 (diff)
downloadpttbbs-2502fc38a34eaf5a146e502a0e87eccfe3283ed9.tar
pttbbs-2502fc38a34eaf5a146e502a0e87eccfe3283ed9.tar.gz
pttbbs-2502fc38a34eaf5a146e502a0e87eccfe3283ed9.tar.bz2
pttbbs-2502fc38a34eaf5a146e502a0e87eccfe3283ed9.tar.lz
pttbbs-2502fc38a34eaf5a146e502a0e87eccfe3283ed9.tar.xz
pttbbs-2502fc38a34eaf5a146e502a0e87eccfe3283ed9.tar.zst
pttbbs-2502fc38a34eaf5a146e502a0e87eccfe3283ed9.zip
warning free
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@863 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/friend.c9
-rw-r--r--mbbsd/mbbsd.c12
-rw-r--r--mbbsd/screen.c4
3 files changed, 15 insertions, 10 deletions
diff --git a/mbbsd/friend.c b/mbbsd/friend.c
index 15fd35dc..127f9f5d 100644
--- a/mbbsd/friend.c
+++ b/mbbsd/friend.c
@@ -1,4 +1,4 @@
-/* $Id: friend.c,v 1.18 2003/05/16 08:25:10 ptt Exp $ */
+/* $Id: friend.c,v 1.19 2003/05/18 07:31:09 in2 Exp $ */
#include "bbs.h"
/* ------------------------------------- */
@@ -95,11 +95,12 @@ friend_add(char *uident, int type, char* des)
/* Thor: avoid uident run away when get data */
strlcpy(t_uident, uident, sizeof(t_uident));
- if (type != FRIEND_ALOHA && type != FRIEND_POST)
+ if (type != FRIEND_ALOHA && type != FRIEND_POST){
if(!des)
getdata(2, 0, friend_desc[type], buf, sizeof(buf), DOECHO);
else
getdata_str(2, 0, friend_desc[type], buf, sizeof(buf), DOECHO, des);
+ }
if ((fp = fopen(fpath, "a"))) {
flock(fileno(fp), LOCK_EX);
@@ -111,7 +112,7 @@ friend_add(char *uident, int type, char* des)
}
void
-friend_special()
+friend_special(void)
{
char genbuf[70], i, fname[70];
@@ -210,7 +211,7 @@ friend_append(int type, int count)
void
friend_delete(char *uident, int type)
{
- FILE *fp, *nfp;
+ FILE *fp, *nfp = NULL;
char fn[80], fnnew[80];
char genbuf[200];
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index b9999eb4..9498f963 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -1,4 +1,4 @@
-/* $Id: mbbsd.c,v 1.78 2003/05/15 23:54:07 victor Exp $ */
+/* $Id: mbbsd.c,v 1.79 2003/05/18 07:31:09 in2 Exp $ */
#include "bbs.h"
#define SOCKET_QLEN 4
@@ -1004,17 +1004,21 @@ telnet_init()
IAC, WILL, TELOPT_SGA
};
char *cmd;
- int n, len, rset;
+ int n, len;
struct timeval to;
char buf[64];
+ fd_set ReadSet, r;
+
+ FD_ZERO(&ReadSet);
+ FD_SET(0, &ReadSet);
for (n = 0, cmd = svr; n < 4; n++) {
len = (n == 1 ? 6 : 3);
write(0, cmd, len);
cmd += len;
to.tv_sec = 3;
to.tv_usec = 0;
- rset = 1;
- if (select(1, (fd_set *) & rset, NULL, NULL, &to) > 0)
+ r = ReadSet;
+ if (select(1, &r, NULL, NULL, &to) > 0)
recv(0, buf, sizeof(buf), 0);
}
}
diff --git a/mbbsd/screen.c b/mbbsd/screen.c
index 23aa9e71..832abfca 100644
--- a/mbbsd/screen.c
+++ b/mbbsd/screen.c
@@ -1,4 +1,4 @@
-/* $Id: screen.c,v 1.14 2003/01/16 11:53:54 kcwu Exp $ */
+/* $Id: screen.c,v 1.15 2003/05/18 07:31:09 in2 Exp $ */
#include "bbs.h"
#ifdef SUPPORT_GB
@@ -379,7 +379,7 @@ outc(unsigned char ch)
if (ch == 'm') {
buf[p++] = '\0';
parsecolor(buf);
- } else if ((p < sizeof(buf)) && (not_alpha(ch))) {
+ } else if (((size_t)p < sizeof(buf)) && (not_alpha(ch))) {
buf[p++] = ch;
return;
}