Changeset 60672abc1c666289ee98f13f3b5ef9ee22c1e05e

Show
Ignore:
Timestamp:
28/11/06 21:27:33 (2 years ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1164745653 +0000
git-parent:

[a9ac3e9e17a136f4114f27f99dae976a81bac7e2]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1164745653 +0000
Message:

Avoid duplicate memory allocation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access/directory.c

    ra9ac3e9 r60672ab  
    394394        const char *entry = pp_dir_content[i]; 
    395395        int i_size_entry = strlen( psz_name ) + 
    396                            strlen( entry ) + 2
     396                           strlen( entry ) + 2 + 7 /* strlen("file://") */
    397397        char psz_uri[i_size_entry]; 
    398         char psz_mrl[i_size_entry + 7]; /* "file://psz_uri" */ 
    399398 
    400399        sprintf( psz_uri, "%s/%s", psz_name, entry); 
     
    473472                } 
    474473 
    475                 sprintf( &psz_mrl, "file://%s", psz_uri ); 
     474                memmove (psz_uri + 7, psz_uri, sizeof (psz_uri) - 7); 
     475                memcpy (psz_uri, "file://", 7); 
    476476                p_input = input_ItemNewWithType( VLC_OBJECT(p_playlist), 
    477                                                  psz_mrl, entry, 0, NULL, 
     477                                                 psz_uri, entry, 0, NULL, 
    478478                                                 -1, ITEM_TYPE_VFILE ); 
    479479                if (p_input != NULL)