Commit 065691d7 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Also use strlcpy()

parent 533d6dbf
...@@ -104,10 +104,7 @@ static void strcpy_strip_ext( char *d, char *s ) ...@@ -104,10 +104,7 @@ static void strcpy_strip_ext( char *d, char *s )
return; return;
} }
else else
{ strlcpy(d, s, tmp - s);
strncpy(d, s, tmp - s);
d[tmp - s] = 0;
}
while( *d ) while( *d )
{ {
*d = tolower(*d); *d = tolower(*d);
...@@ -298,11 +295,8 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path, ...@@ -298,11 +295,8 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
strcpy( f_fname, tmp+1 ); // we skip the seperator, so it will still fit in the allocated space strcpy( f_fname, tmp+1 ); // we skip the seperator, so it will still fit in the allocated space
dirlen = strlen(psz_fname) - strlen(tmp) + 1; // add the seperator dirlen = strlen(psz_fname) - strlen(tmp) + 1; // add the seperator
f_dir = malloc( dirlen + 1 ); f_dir = malloc( dirlen + 1 );
if( f_dir ) if( f_dir != NULL )
{ strlcpy( f_dir, psz_fname, dirlen );
strncpy( f_dir, psz_fname, dirlen );
f_dir[dirlen] = 0;
}
} }
else else
{ {
......
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