[vlc-devel] [PATCH 4/9] raop: Implement options for password

Rémi Denis-Courmont remi at remlab.net
Wed Jul 29 17:58:40 CEST 2009


Le lundi 27 juillet 2009 11:37:30 jpd at videolan.org, vous avez écrit :
> On Sun, Jul 26, 2009 at 12:01:48AM +0200, Michael Hanselmann wrote:
> > On Fri, Jul 24, 2009 at 11:41 AM, <jpd at videolan.org> wrote:
> > > On Fri, Jul 24, 2009 at 11:24:59AM +0200, Michael Hanselmann wrote:
> > >> So, the strsep(3) call in my patch just replaces the first occurence
> > >> of "\r" or "\n" after the password.
> > >
> > > Right. But you would only need "\n" if the file is opened in "text"
> > > mode. And in that case, strlen()-1 would do equally well to find the
> > > newline if it's there.
> >
> > It's not equally well. The function should just return the first line,
> > not just remove the last newline.
>
> Isn't that, minus the removing of the newline, what fgets() does anyway?
>
> > +    psz_newline = index(ps_buffer, '\n');
> > +    if ( psz_newline != NULL )
> > +        *psz_newline = '\0';
>
> That works, too. Now if fgets would return the number of characters read
> you could dispense with the strlen/index entirely, but alas, it doesn't.

Are you fine with the last patch or not?
There has been no other comments, so I assume we can merge the rest.


-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list