[vlc-devel] [PATCH] sftp: implement directory listing

Jean-Baptiste Kempf jb at videolan.org
Mon Mar 16 10:24:24 CET 2015


On 14 Mar, Petri Hintukainen wrote :
> +/*****************************************************************************
> + * Directory access
> + *****************************************************************************/
> +
> +static int DirRead (access_t *p_access, input_item_node_t *p_current_node)
> +{
> +    access_sys_t *p_sys = p_access->p_sys;
> +    LIBSSH2_SFTP_ATTRIBUTES attrs;
> +    size_t i_size = 1024;

Why 1024 ?

> +    char *psz_file = malloc( i_size );

Unchecked malloc.

> +    while( 0 != ( err = libssh2_sftp_readdir( p_sys->file, psz_file, i_size, &attrs ) ) ) {
> +
Weird { placement

Rest is good.

With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list