]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
dvr: Buffers for scraper specifier should not use PATH_MAX. (#4667)
authorE.Smith <31170571+azlm8t@users.noreply.github.com>
Fri, 13 Oct 2017 23:14:24 +0000 (00:14 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 18 Oct 2017 17:16:04 +0000 (19:16 +0200)
The buffers were incorrectly using PATH_MAX to size their buffers.

Also add missing newline in property for pathname.md.

Issue: #4667

docs/property/pathname.md
src/dvr/dvr_rec.c

index e25a550f717d136bf9c8566f949f286e07c1e9ed..be6940dec11ebe22d7eae5a5ad61b61564762efb 100644 (file)
@@ -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 
index c098591258fd54c42213a38655d5c4826760e404..7b6512fc28f4b66be9821925cbda3216b50ce8b8 100644 (file)
@@ -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.