summaryrefslogtreecommitdiffstats
path: root/cfgparser.c
diff options
context:
space:
mode:
authorszabii <szabii@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-03-21 02:56:06 +0000
committerszabii <szabii@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-03-21 02:56:06 +0000
commit2186305c47bbc34696235abcd81f3bd6a5d938aa (patch)
treeab86d642375187bb70c2759157f7b998043d5045 /cfgparser.c
parente0f650031fb81e30cc41a0702cdf63d86e894aa6 (diff)
downloadmpv-2186305c47bbc34696235abcd81f3bd6a5d938aa.tar.bz2
mpv-2186305c47bbc34696235abcd81f3bd6a5d938aa.tar.xz
fix...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@180 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'cfgparser.c')
-rw-r--r--cfgparser.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cfgparser.c b/cfgparser.c
index 646af3460f..7886d0d9de 100644
--- a/cfgparser.c
+++ b/cfgparser.c
@@ -228,8 +228,8 @@ int parse_config_file(struct config *conf, char *conffile)
#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 @@ int parse_config_file(struct config *conf, char *conffile)
#endif
if (++recursion_depth > MAX_RECURSION_DEPTH) {
printf("too deep 'include'. check your configfiles\n");
+ --recursion_depth;
return -1;
}
@@ -253,7 +254,7 @@ int parse_config_file(struct config *conf, char *conffile)
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;