diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2013-03-11 11:07:59 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2013-03-11 11:07:59 +0100 |
commit | bc72b7e6cd2468a9f8daea34dba524d81d60702f (patch) | |
tree | 6e2c7b4af8496a65acbb577e6e3af30b0be4e361 | |
parent | f3ca6f2083229732d78ce6920f880fb6113e0c97 (diff) | |
download | vdr-bc72b7e6cd2468a9f8daea34dba524d81d60702f.tar.gz vdr-bc72b7e6cd2468a9f8daea34dba524d81d60702f.tar.bz2 |
Fixed using PATH_MAX and NAME_MAX (+/-1 because the first one includes the terminating 0, while the latter doesn't)
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | config.h | 8 | ||||
-rw-r--r-- | recording.c | 4 | ||||
-rw-r--r-- | timers.h | 4 | ||||
-rw-r--r-- | vdr.c | 8 |
5 files changed, 14 insertions, 12 deletions
@@ -7735,3 +7735,5 @@ Video Disk Recorder Revision History - Updated the Hungarian OSD texts (thanks to István Füley). - Updated the Russian OSD texts (thanks to Oleg Roitburd). - Updated the Polish OSD texts (thanks to Marek Nazarko). +- Fixed using PATH_MAX and NAME_MAX (+/-1 because the first one includes the + terminating 0, while the latter doesn't). @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.h 2.72 2013/03/10 15:52:11 kls Exp $ + * $Id: config.h 2.74 2013/03/11 11:07:59 kls Exp $ */ #ifndef __CONFIG_H @@ -27,8 +27,8 @@ // The plugin API's version number: -#define APIVERSION "1.7.40" -#define APIVERSNUM 10740 // Version * 10000 + Major * 100 + Minor +#define APIVERSION "1.7.41" +#define APIVERSNUM 10741 // Version * 10000 + Major * 100 + Minor // When loading plugins, VDR searches them by their APIVERSION, which // may be smaller than VDRVERSION in case there have been no changes to @@ -260,7 +260,7 @@ public: int MenuScrollWrap; int MenuKeyCloses; int MarkInstantRecord; - char NameInstantRecord[NAME_MAX]; + char NameInstantRecord[NAME_MAX + 1]; int InstantRecordTime; int LnbSLOF; int LnbFrequLo; diff --git a/recording.c b/recording.c index 032175dd..f43ce52e 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.c 2.90 2013/03/04 14:02:40 kls Exp $ + * $Id: recording.c 2.91 2013/03/11 10:34:41 kls Exp $ */ #include "recording.h" @@ -66,7 +66,7 @@ #define MAX_LINK_LEVEL 6 -int DirectoryPathMax = PATH_MAX; +int DirectoryPathMax = PATH_MAX - 1; int DirectoryNameMax = NAME_MAX; bool DirectoryEncoding = false; int InstanceId = 0; @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: timers.h 2.6 2013/02/05 11:23:24 kls Exp $ + * $Id: timers.h 2.7 2013/03/11 10:35:53 kls Exp $ */ #ifndef __TIMERS_H @@ -39,7 +39,7 @@ private: int stop; int priority; int lifetime; - mutable char file[NAME_MAX * 2]; // *2 to be able to hold 'title' and 'episode', which can each be up to 255 characters long + mutable char file[NAME_MAX * 2 + 1]; // *2 to be able to hold 'title' and 'episode', which can each be up to 255 characters long char *aux; const cEvent *event; public: @@ -22,7 +22,7 @@ * * The project's page is at http://www.tvdr.de * - * $Id: vdr.c 2.50 2013/03/03 10:25:11 kls Exp $ + * $Id: vdr.c 2.51 2013/03/11 10:31:24 kls Exp $ */ #include <getopt.h> @@ -281,7 +281,7 @@ int main(int argc, char *argv[]) case 'd' | 0x100: { char *s = optarg; int n = strtol(s, &s, 10); - if (n <= 0 || n >= PATH_MAX) { + if (n <= 0 || n >= PATH_MAX) { // PATH_MAX includes the terminating 0 fprintf(stderr, "vdr: invalid directory path length: %s\n", optarg); return 2; } @@ -293,7 +293,7 @@ int main(int argc, char *argv[]) return 2; } n = strtol(s, &s, 10); - if (n <= 0 || n >= NAME_MAX) { + if (n <= 0 || n > NAME_MAX) { // NAME_MAX excludes the terminating 0 fprintf(stderr, "vdr: invalid directory name length: %s\n", optarg); return 2; } @@ -530,7 +530,7 @@ int main(int argc, char *argv[]) "\n", DEFAULTCACHEDIR, DEFAULTCONFDIR, - PATH_MAX, + PATH_MAX - 1, NAME_MAX, DEFAULTEPGDATAFILENAME, MAXVIDEOFILESIZEDEFAULT, |