From owner-freebsd-ports Sun Dec 30 14:10:17 2001 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id D88F937B41C for ; Sun, 30 Dec 2001 14:10:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id fBUMA1N38100; Sun, 30 Dec 2001 14:10:01 -0800 (PST) (envelope-from gnats) Date: Sun, 30 Dec 2001 14:10:01 -0800 (PST) Message-Id: <200112302210.fBUMA1N38100@freefall.freebsd.org> To: freebsd-ports@FreeBSD.org Cc: From: Pierre-Paul Lavoie Subject: Re: ports/32899: mail/nbsmtp causes segfaults while a command line parsing Reply-To: Pierre-Paul Lavoie Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR ports/32899; it has been noted by GNATS. From: Pierre-Paul Lavoie To: freebsd-gnats-submit@FreeBSD.org, fuyuki@mj.0038.net Cc: Subject: Re: ports/32899: mail/nbsmtp causes segfaults while a command line parsing Date: Sun, 30 Dec 2001 18:08:11 -0400 Here's a possible patch using getopt -ppl --- nbsmtp.cFri Apr 6 21:09:01 2001 +++ nbsmtp-patch.cSun Dec 30 12:05:03 2001 @@ -19,6 +19,8 @@ */ #include +#include +#include #include #include #include @@ -76,42 +78,46 @@ { printf("Usage:\n"); printf("%s -d domain -f from@addr -h host [-p port] [-l debuglevel]\n", prog); + exit(EXIT_FAILURE); } int main(int argc, char *argv[]) { - int i; + int ch; - for(i=1; i 1) stdlog = fopen("nbsmtp.log", "w"); else stdlog = stdout; break; + case '?': default: print_usage(argv[0]); +break; } } + argc -= optind; + argv += optind; if(domain==NULL || fromaddr==NULL || host==NULL){ print_usage(argv[0]); - return 1; } if(port==0) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message