[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] NULL-terminate list of arguments in server-mode
From: |
Derek R. Price |
Subject: |
Re: [PATCH] NULL-terminate list of arguments in server-mode |
Date: |
Mon, 01 Oct 2001 15:20:51 -0400 |
Stephen Rasku wrote:
> Derek Price wrote:
> >
> >Alexey Mahotkin wrote:
> >
> >> I've been implementing the "acl" command and was bitten by the fact
> >> that serve_argument() does not NULL-terminates a list of arguments
> >> received from the client. This does no harm because existing
> >> server-side code always uses something like
> >>
> >> for (i = 0; i < argc; i++)
> >>
> >> and never something like
> >>
> >> for (; *argv; argv++)
> >>
> >> I'd like to do the latter (and it's obviously good to have more
> >> traditional argv[]), so here is the patch:
> >
> >Is this really traditional? I've never seen it in over 10 years of C
> >programming. Can you point me at the appropriate standard?
> >
>
> I think he's talking about the argv[] array, not the programming
> idiom. In my experience, argv[argc] == NULL.
Well, that's what I figured he was talking about, but I've never seen it
and my only C reference doesn't mention it. I'd be happier about it
being checked in if I could look at a standard doc.
Derek
--
Derek Price CVS Solutions Architect ( http://CVSHome.org )
mailto:dprice@collab.net CollabNet ( http://collab.net )
--
The price of freedom is eternal vigilance.
- Thomas Jefferson