From e373e006e646613d0ff3383342e1640788f70947 Mon Sep 17 00:00:00 2001 From: Mark Janssen Date: Mon, 9 Jul 2007 11:22:18 +0000 Subject: [PATCH] Fix typos Fix malloc/buffer Remove spurious syslog git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@159 bc163920-b10d-0410-b2c5-a5491ca2ceef --- io.c | 2 +- proxytunnel.c | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/io.c b/io.c index 5788c5d..1a66a26 100644 --- a/io.c +++ b/io.c @@ -62,7 +62,7 @@ int readline(PTSTREAM *pts) if( args_info.verbose_flag ) { /* Copy line of data into dstr without trailing newline */ - char * dstr = malloc(strlen(buf)); + char * dstr = malloc(strlen(buf) + 1); strlcpy( dstr, buf, strlen(buf) - 1); if (strcmp(dstr, "")) message( "<- %s\n", dstr ); diff --git a/proxytunnel.c b/proxytunnel.c index c76a2cc..487d704 100644 --- a/proxytunnel.c +++ b/proxytunnel.c @@ -143,10 +143,9 @@ void closeall() { message( "Tunnel closed\n" ); } -#ifdef CYGWIN message( "Goodbye" ); -#else - syslog(LOG_NOTICE,"Goodbye..."); + +#ifndef CYGWIN closelog(); #endif @@ -221,7 +220,7 @@ void do_daemon() /* For the moment, turn of forking into background on the cygwin platform * so users can run it in a command window and ctrl-c it to cancel. - * Also so we can put logging there, since there's nog syslog on cygwin (AFAIK) + * Also so we can put logging there, since there's no syslog on cygwin (AFAIK) * -- Maniac */ #ifndef CYGWIN @@ -308,20 +307,13 @@ void do_daemon() /* Run the tunnel - we should stay here indefinitely */ cpio(std, stunnel); -///// exit( 0 ); } memcpy( &addr, &sa_cli.sin_addr.s_addr, 4 ); snprintf( (char *) buf, 16, "%u.%u.%u.%u", addr[0], addr[1], addr[2], addr[3] ); -#ifdef CYGWIN message( "Started tunnel pid=%d for connection from %s", pid, buf ); -#else - syslog( LOG_NOTICE, - "Started tunnel pid=%d for connection from %s", pid, buf ); - -#endif close( sd_client ); } }