From c3319cfa1528effa569f20cea7b177bed580b420 Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Sun, 16 Oct 2005 21:54:04 +0000 Subject: [PATCH] * Fix the sub autodetect directory string --- src/input/subtitles.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/input/subtitles.c b/src/input/subtitles.c index eee4364678..fdb4ee7ec1 100644 --- a/src/input/subtitles.c +++ b/src/input/subtitles.c @@ -302,11 +302,11 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path, f_fname = malloc( strlen(tmp) ); if( f_fname ) strcpy( f_fname, tmp+1 ); // we skip the seperator, so it will still fit in the allocated space - dirlen = strlen(psz_fname) - strlen(tmp); + dirlen = strlen(psz_fname) - strlen(tmp) + 1; // add the seperator f_dir = malloc( dirlen + 1 ); if( f_dir ) { - strncpy( f_dir, psz_fname, dirlen + 1 ); + strncpy( f_dir, psz_fname, dirlen ); f_dir[dirlen] = 0; } } -- 2.39.2