From: E.Smith <31170571+azlm8t@users.noreply.github.com> Date: Fri, 13 Oct 2017 23:14:24 +0000 (+0100) Subject: dvr: Buffers for scraper specifier should not use PATH_MAX. (#4667) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=83cf79e12a6ba9cb5b66160401fbc6035510eb6c;p=thirdparty%2Ftvheadend.git dvr: Buffers for scraper specifier should not use PATH_MAX. (#4667) The buffers were incorrectly using PATH_MAX to size their buffers. Also add missing newline in property for pathname.md. Issue: #4667 --- diff --git a/docs/property/pathname.md b/docs/property/pathname.md index e25a550f7..be6940dec 100644 --- a/docs/property/pathname.md +++ b/docs/property/pathname.md @@ -19,6 +19,7 @@ Format | Description | Example `$x` | Filename extension (from the active stream muxer | mkv `%F` | ISO 8601 date format | 2011-03-19 `%R` | The time in 24-hour notation | 14:12 + The format strings `$t`,`$s`,`%e`,`$c` also have delimiter variants such as `$ t` (space after the dollar character), `$-t`, `$_t`, `$.t`, `$,t`, `$;t`. In these cases, the delimiter is applied diff --git a/src/dvr/dvr_rec.c b/src/dvr/dvr_rec.c index c09859125..7b6512fc2 100644 --- a/src/dvr/dvr_rec.c +++ b/src/dvr/dvr_rec.c @@ -359,8 +359,8 @@ dvr_sub_episode(const char *id, const char *fmt, const void *aux, char *tmp, siz static const char * _dvr_sub_scraper_friendly(const char *id, const char *fmt, const void *aux, char *tmp, size_t tmplen, int with_genre_subdir) { - char date_buf[MAX(PATH_MAX, 512)] = { 0 }; - char episode_buf[MAX(PATH_MAX, 512)] = { 0 }; + char date_buf[512] = { 0 }; + char episode_buf[512] = { 0 }; const dvr_entry_t *de = aux; /* Can't be const due to call to epg_episode_number_format */ /*const*/ epg_episode_t *episode = de->de_bcast ? de->de_bcast->episode : 0; @@ -379,8 +379,8 @@ _dvr_sub_scraper_friendly(const char *id, const char *fmt, const void *aux, char subtitle = desc = NULL; } - char title_buf[MAX(PATH_MAX, 512)] = { 0 }; - char subtitle_buf[MAX(PATH_MAX, 512)] = { 0 }; + char title_buf[512] = { 0 }; + char subtitle_buf[512] = { 0 }; /* Copy a cleaned version in to our buffers. * Since dvr_clean_directory_separator _can_ modify source if source!=dest * it means we have to remove our const when we call it.