diff options
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | cmd.c | 10 | ||||
-rw-r--r-- | configure.in | 16 | ||||
-rw-r--r-- | powwow-muc.c | 6 | ||||
-rw-r--r-- | tcp.c | 4 | ||||
-rw-r--r-- | utils.c | 2 |
6 files changed, 25 insertions, 15 deletions
@@ -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 @@ -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 */ @@ -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! @@ -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; |