summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2013-03-11 11:07:59 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2013-03-11 11:07:59 +0100
commitbc72b7e6cd2468a9f8daea34dba524d81d60702f (patch)
tree6e2c7b4af8496a65acbb577e6e3af30b0be4e361 /vdr.c
parentf3ca6f2083229732d78ce6920f880fb6113e0c97 (diff)
downloadvdr-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)
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/vdr.c b/vdr.c
index f46589f5..4b23312b 100644
--- a/vdr.c
+++ b/vdr.c
@@ -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,