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

Michael Hanselmann public at hansmi.ch
Fri Jul 24 11:24:59 CEST 2009


On Fri, Jul 24, 2009 at 9:11 AM, <jpd at videolan.org> wrote:
> On Thu, Jul 23, 2009 at 09:49:11PM +0200, Michael Hanselmann wrote:
>> +static const char psz_delim_linebreak[] = "\r\n";
>
> I think this and its use are the wrong approach in that CRLF translation
> is better handled by libc io facilities. Unless, of course, you have
> good reason not to, but I don't see that here. Is this ment to only work
> on windows?

Quoting strsep(3) on Mac OS X: “The strsep() function locates, in the
string referenced by *stringp, the first occurrence of any character
in the string delim (or the terminating `\0' character) and replaces
it with a `\0'.” fgets(3) returns the linebreak (fgets(3): “Reading
stops when a newline character is found, at end-of-file or error. The
newline, if any, is retained.”) and I wouldn't know of any libc
function to just remove the linebreak. So, the strsep(3) call in my
patch just replaces the first occurence of "\r" or "\n" after the
password.

Regards,
Michael

-- 
http://hansmi.ch/



More information about the vlc-devel mailing list