aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Slaven <bpk@hoopajoo.net>2013-07-15 16:23:03 (GMT)
committerSteve Slaven <bpk@hoopajoo.net>2013-07-15 16:23:03 (GMT)
commita1120b662b4653e34ed663e21d7bb06cbba49499 (patch)
treebca0a71c91e8fb604fc03c96af8d98beb96a597b
parentf9635fea9f805d6f9930e47a4a1c8c5592849f3a (diff)
parent2676fae2cf3a00368f311d52f3941b62005aee72 (diff)
downloadpowwow-a1120b662b4653e34ed663e21d7bb06cbba49499.zip
powwow-a1120b662b4653e34ed663e21d7bb06cbba49499.tar.gz
powwow-a1120b662b4653e34ed663e21d7bb06cbba49499.tar.bz2
pull from kalev
-rw-r--r--README2
-rw-r--r--cmd.c10
-rw-r--r--configure.in16
-rw-r--r--powwow-muc.c6
-rw-r--r--tcp.c4
-rw-r--r--utils.c2
6 files changed, 25 insertions, 15 deletions
diff --git a/README b/README
index 4c80dd9..bba481e 100644
--- a/README
+++ b/README
@@ -142,7 +142,7 @@ AUTHORS OF POWWOW
If you forgot where you downloaded powwow from, you can get it from
the above address.
- To learn more about MUME, have a look at http://fire.pvv.org/mume/
+ To learn more about MUME, have a look at http://www.mume.org
which also explains how to connect.
COPYRIGHT
diff --git a/cmd.c b/cmd.c
index edd6d00..551a069 100644
--- a/cmd.c
+++ b/cmd.c
@@ -339,7 +339,7 @@ static void cmd_module __P1 (char *,arg) {
/* I changed it to work this way so that you can have libs in multiple places and
* also eventually to allow it to use .dll instead of .so under the cygwin environment */
for( pindex = 0; pindex < 5; pindex++ ) {
- bzero( libname, 1024 );
+ memset( libname, 0, sizeof libname );
/* don't look for name without .so, it breaks if you have a file
* with the same name in the current dir and making it .so for sure
@@ -574,9 +574,11 @@ static void cmd_shell __P1 (char *,arg)
}
} else {
tty_quit();
-
- system(arg);
-
+
+ if (system(arg) == -1) {
+ perror("system()");
+ }
+
tty_start();
tty_gotoxy(col0 = 0, line0 = lines -1);
tty_puts(tty_clreoln);
diff --git a/configure.in b/configure.in
index d17fc25..762275e 100644
--- a/configure.in
+++ b/configure.in
@@ -78,16 +78,21 @@ AC_PROG_CC
AC_PROG_LN_S
# Checks for libraries.
-AC_SEARCH_LIBS(initscr,[ncurses curses])
AC_CHECK_FUNC(regcomp,AC_DEFINE(USE_REGEXP))
AC_CHECK_FUNC(lrand48,,AC_DEFINE(USE_RANDOM))
+if test "x${enable_vt100}" != "xyes"; then
+ AC_SEARCH_LIBS(initscr,[ncurses curses], [], [
+ if test "x${enable_vt100}" = "xno" ; then
+ AC_MSG_ERROR([*** curses libraries not found])
+ fi])
+fi
+
# Dynamic modules
-dl_ldflags=
+AC_SEARCH_LIBS(dlopen,[dl],[
+ AC_DEFINE(HAVE_LIBDL)
+ dl_ldflags="-rdynamic"])
AC_SUBST(dl_ldflags)
-AC_CHECK_LIB(dl,dlopen,
- AC_DEFINE(HAVE_LIBDL)
- AC_SUBST(dl_ldflags,"-rdynamic -ldl"))
# Checks for header files.
AC_CHECK_HEADERS([stdlib.h unistd.h])
@@ -107,7 +112,6 @@ AC_C_CONST
# Checks for library functions.
AC_FUNC_MALLOC
-AC_CHECK_FUNCS([bzero])
AC_OUTPUT(Makefile)
diff --git a/powwow-muc.c b/powwow-muc.c
index c98547e..4f8ae18 100644
--- a/powwow-muc.c
+++ b/powwow-muc.c
@@ -82,8 +82,8 @@ int main( int argc, char *argv[] ) {
timeout( 0 );
looping = 1;
while( looping ) {
- bzero( line, 1000 );
- fgets( line, 1000, in );
+ memset( line, 0, sizeof line );
+ fgets( line, sizeof line, in );
/* get file pos */
new_pos = curr_pos = ftell( in );
@@ -284,7 +284,7 @@ int main( int argc, char *argv[] ) {
/* read to next newline so we don't break up
lines seeking around */
- fgets( line, 1000, in );
+ fgets( line, sizeof line, in );
new_pos = ftell( in );
/* Make a note of moving */
diff --git a/tcp.c b/tcp.c
index f4af987..2cca739 100644
--- a/tcp.c
+++ b/tcp.c
@@ -226,6 +226,10 @@ int tcp_connect __P2 (char *,addr, int,port)
if (setsockopt(newtcp_fd, SOL_TCP, TCP_NODELAY, &opt, sizeof(opt)))
errmsg("setsockopt(TCP_NODELAY) failed");
+ /* TCP keep-alive */
+ if (setsockopt(newtcp_fd, SOL_SOCKET, SO_KEEPALIVE, &opt, sizeof(opt)))
+ errmsg("setsockopt(SO_KEEPALIVE) failed");
+
/*
* Then, close-on-exec:
* we don't want children to inherit the socket!
diff --git a/utils.c b/utils.c
index 58478c7..1b2013a 100644
--- a/utils.c
+++ b/utils.c
@@ -519,7 +519,7 @@ static void wrap_print __P1 (char *,s)
ansibug = 1;
#endif
- while (l >= cols_1 - col0) {
+ while (l >= cols_1 - col0 && *s) {
p = buf; m = 0; state = NORM;
lp = ls = NULL;