Commit 388d2d1b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Clean up

parent 1715ecf8
...@@ -411,19 +411,16 @@ static int ReadDir( playlist_t *p_playlist, const char *psz_name, ...@@ -411,19 +411,16 @@ static int ReadDir( playlist_t *p_playlist, const char *psz_name,
for( a = 0; a < i_extensions; a++ ) for( a = 0; a < i_extensions; a++ )
{ {
int b; char *tmp, *ptr;
char *tmp;
while( psz_parser[0] != '\0' && psz_parser[0] == ' ' ) psz_parser++; while( psz_parser[0] != '\0' && psz_parser[0] == ' ' ) psz_parser++;
for( b = 0; psz_parser[b] != '\0'; b++ ) ptr = strchr( psz_parser, ',');
{ tmp = ( ptr == NULL )
if( psz_parser[b] == ',' ) break; ? strdup( psz_parser )
} : strndup( psz_parser, ptr - psz_parser );
tmp = malloc( b + 1 );
strncpy( tmp, psz_parser, b );
tmp[b] = 0;
ppsz_extensions[a] = tmp; ppsz_extensions[a] = tmp;
psz_parser += b+1; psz_parser = ptr + 1;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment