Mercurial > mplayer.hg
diff cfgparser.c @ 179:6f890e61739b
fix...
author | szabii |
---|---|
date | Wed, 21 Mar 2001 02:56:06 +0000 |
parents | 554c6e5f36ef |
children | aa52cdb712d8 |
line wrap: on
line diff
--- a/cfgparser.c Wed Mar 21 00:14:42 2001 +0000 +++ b/cfgparser.c Wed Mar 21 02:56:06 2001 +0000 @@ -228,8 +228,8 @@ #define MAX_PARAM_LEN 100 FILE *fp; char *line; - char opt[MAX_OPT_LEN]; - char param[MAX_PARAM_LEN]; + char opt[MAX_OPT_LEN + 1]; + char param[MAX_PARAM_LEN + 1]; char c; /* for the "" and '' check */ int tmp; int line_num = 0; @@ -243,6 +243,7 @@ #endif if (++recursion_depth > MAX_RECURSION_DEPTH) { printf("too deep 'include'. check your configfiles\n"); + --recursion_depth; return -1; } @@ -253,7 +254,7 @@ goto out; } - if ((line = (char *) malloc(MAX_LINE_LEN)) == NULL) { + if ((line = (char *) malloc(MAX_LINE_LEN + 1)) == NULL) { perror("parse_config_file: can't get memory for 'line'"); ret = -1; goto out;