summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-02-03 22:09:20 +0100
committerwm4 <wm4@nowhere>2014-02-03 22:11:03 +0100
commitd91b9e9f3b40798b65819f3bf2e13b7e550f5c80 (patch)
tree97d027e8a648668620ba82d2dec72a52e60e73b8 /demux
parent208c54a710e5e5d823c9b046a2bf0159060e3ae8 (diff)
downloadmpv-d91b9e9f3b40798b65819f3bf2e13b7e550f5c80.tar.bz2
mpv-d91b9e9f3b40798b65819f3bf2e13b7e550f5c80.tar.xz
mf: don't limit filename length with PATH_MAX
Use an arbitrary constant instead, which is as good as PATH_MAX. This helps us to avoid having to think about pull request #523. Also fix a case where a potentially signed char was passed to isspace().
Diffstat (limited to 'demux')
-rw-r--r--demux/mf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/demux/mf.c b/demux/mf.c
index 0aabd46bb8..b538943aff 100644
--- a/demux/mf.c
+++ b/demux/mf.c
@@ -64,11 +64,11 @@ mf_t *open_mf_pattern(void *talloc_ctx, struct mp_log *log, char *filename)
if (filename[0] == '@') {
FILE *lst_f = fopen(filename + 1, "r");
if (lst_f) {
- char *fname = talloc_size(mf, MP_PATH_MAX);
- while (fgets(fname, MP_PATH_MAX, lst_f)) {
+ char *fname = talloc_size(mf, 512);
+ while (fgets(fname, 512, lst_f)) {
/* remove spaces from end of fname */
char *t = fname + strlen(fname) - 1;
- while (t > fname && isspace(*t))
+ while (t > fname && isspace((unsigned char)*t))
*(t--) = 0;
if (!mp_path_exists(fname)) {
mp_verbose(log, "file not found: '%s'\n", fname);