From owner-freebsd-hackers Wed Feb 19 15:06:32 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id PAA24979 for hackers-outgoing; Wed, 19 Feb 1997 15:06:32 -0800 (PST) Received: from mail.crl.com (mail.crl.com [165.113.1.22]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id PAA24831; Wed, 19 Feb 1997 15:03:05 -0800 (PST) Received: from hydrogen.nike.efn.org (resnet.uoregon.edu) by mail.crl.com with SMTP id AA16202 (5.65c/IDA-1.5); Wed, 19 Feb 1997 14:37:21 -0800 Received: from localhost (localhost [127.0.0.1]) by hydrogen.nike.efn.org (8.8.4/8.8.4) with SMTP id OAA08110; Wed, 19 Feb 1997 14:31:04 -0800 (PST) Date: Wed, 19 Feb 1997 14:31:03 -0800 (PST) From: John-Mark Gurney Reply-To: John-Mark Gurney To: Guido van Rooij Cc: "Alexander V. Kalganov" , audit-bin@FreeBSD.ORG, FreeBSD-hackers Subject: Re: hmm In-Reply-To: <199702192053.VAA02956@gvr.win.tue.nl> Message-Id: X-Pgp-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Wed, 19 Feb 1997, Guido van Rooij wrote: > Alexander V. Kalganov wrote: > > Hi > > Maybe this is a dumb question, but would someone explain me what the > > following is done for? > > > > char *p; > > > > if ((p = argv[0]) == NULL) > > errx(2,"test: argc is zero"); > > > > It seems a bit strange to me. Just like the first part of the line > underneath btw: > if (*p != '\0' && p[strlen(p) - 1] == '[') { > ^^^^^^^^^^ that makes sure that the strlen(p) > 0... you wouldn't want to access p[-1] would you?? hope this helps... ttyl.. John-Mark gurney_j@efn.org http://resnet.uoregon.edu/~gurney_j/ Modem/FAX: (541) 683-6954 (FreeBSD Box) Live in Peace, destroy Micro$oft, support free software, run FreeBSD (unix)