Date: Wed, 19 Feb 1997 14:31:03 -0800 (PST) From: John-Mark Gurney <jmg@nike.efn.org> To: Guido van Rooij <guido@gvr.win.tue.nl> Cc: "Alexander V. Kalganov" <top@sonic.cris.net>, audit-bin@FreeBSD.ORG, FreeBSD-hackers <FreeBSD-hackers@FreeBSD.ORG> Subject: Re: hmm Message-ID: <Pine.BSF.3.95q.970219142947.405n-100000@hydrogen.nike.efn.org> In-Reply-To: <199702192053.VAA02956@gvr.win.tue.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.970219142947.405n-100000>