diff options
author | jstebbins <[email protected]> | 2014-05-27 18:40:27 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2014-05-27 18:40:27 +0000 |
commit | 0340cdc16c3cf51f24a2ddfcb40cd8d3b7257e17 (patch) | |
tree | a495a8b246ce107451c5a2528f61338c1d9bcf3b /libhb | |
parent | 9ab2cefc88f522c02817a248e2b8d964d186c04f (diff) |
libhb: fix overwriting of source path
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6206 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/bd.c | 6 | ||||
-rw-r--r-- | libhb/dvd.c | 4 | ||||
-rw-r--r-- | libhb/dvdnav.c | 4 |
3 files changed, 6 insertions, 8 deletions
diff --git a/libhb/bd.c b/libhb/bd.c index b0b540ea5..b587a24f0 100644 --- a/libhb/bd.c +++ b/libhb/bd.c @@ -258,12 +258,10 @@ hb_title_t * hb_bd_title_scan( hb_bd_t * d, int tt, uint64_t min_duration ) p_last = &p_cur[1]; } } - char *dot_term = strrchr(p_last, '.'); + snprintf( title->name, sizeof( title->name ), "%s", p_last ); + char *dot_term = strrchr(title->name, '.'); if (dot_term) *dot_term = '\0'; - snprintf( title->name, sizeof( title->name ), "%s", p_last ); - strncpy( title->path, d->path, 1024 ); - title->path[1023] = 0; title->vts = 0; title->ttn = 0; diff --git a/libhb/dvd.c b/libhb/dvd.c index 628585b31..418382317 100644 --- a/libhb/dvd.c +++ b/libhb/dvd.c @@ -192,10 +192,10 @@ static hb_title_t * hb_dvdread_title_scan( hb_dvd_t * e, int t, uint64_t min_dur p_last = &p_cur[1]; } } - char *dot_term = strrchr(p_last, '.'); + snprintf( title->name, sizeof( title->name ), "%s", p_last ); + char *dot_term = strrchr(title->name, '.'); if (dot_term) *dot_term = '\0'; - snprintf( title->name, sizeof( title->name ), "%s", p_last ); } /* VTS which our title is in */ diff --git a/libhb/dvdnav.c b/libhb/dvdnav.c index 081116c3b..3c820b789 100644 --- a/libhb/dvdnav.c +++ b/libhb/dvdnav.c @@ -339,10 +339,10 @@ static hb_title_t * hb_dvdnav_title_scan( hb_dvd_t * e, int t, uint64_t min_dura p_last = &p_cur[1]; } } - char *dot_term = strrchr(p_last, '.'); + snprintf( title->name, sizeof( title->name ), "%s", p_last ); + char *dot_term = strrchr(title->name, '.'); if (dot_term) *dot_term = '\0'; - snprintf( title->name, sizeof( title->name ), "%s", p_last ); } /* VTS which our title is in */ |