Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
DVR: limit the filename length to 255 if windows compatible filenames…
… are checked, fixes #3541

- unfortunately pathconf(filename, _PC_NAME_MAX) returns a large value
  for VFAT (internal unicode handling)
  • Loading branch information
perexg committed Feb 19, 2016
1 parent d974373 commit cfbda5e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/dvr/dvr_rec.c
Expand Up @@ -752,6 +752,8 @@ pvr_generate_filename(dvr_entry_t *de, const streaming_start_t *ss)
max = pathconf(filename, _PC_NAME_MAX);
if (max < 8)
max = NAME_MAX;
if (max > 255 && cfg->dvr_windows_compatible_filenames)
max = 255;
max -= 2;
j = strlen(filename);
snprintf(filename + j, sizeof(filename) - j, "/%s", dirsep);
Expand Down

0 comments on commit cfbda5e

Please sign in to comment.