[vlc-devel] [PATCH] upnp: fetch all media items correctly. (#6716)

Naohiro KORIYAMA nkoriyama at gmail.com
Mon Apr 30 09:35:11 CEST 2012


Thanks agin,

2012/4/30 Jean-Baptiste Kempf <jb at videolan.org>:
> On Mon, Apr 30, 2012 at 02:12:54PM +0900, Naohiro KORIYAMA wrote :
>> > Why long?
>>
>> Indeed. I fix it.
>
> strtol returns long. But long is not int size on some 64bits
> architectures, IIRC. Sometimes strtoll makes sense.

How about this?

    char *psz_end;
    long l = strtol( psz_number_returned, &psz_end, 10 );
    if( *psz_end ||  ll < 0 || ll > INT_MAX )
    {
        return 0;
    }
    else
    {
        return (int)l;
    }

or

    char *psz_end;
    long long ll = strtoll( psz_number_returned, &psz_end, 10 );
    if( *psz_end || ret < 0 || ll > INT_MAX )
    {
        return 0;
    }
    else
    {
        return (int)ll;
    }


Best regards,
-- 
KORIYAMA, Naohiro
nkoriyama at gmail.com



More information about the vlc-devel mailing list