diff options
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-04-01 09:38:37 +0000 |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-04-01 09:38:37 +0000 |
commit | 63897a417917907099b72f4e679890355a7a78a0 (patch) | |
tree | f5be9593ec15e31cf55444f72446f45c57c9d4f8 | |
parent | d001e08133763427fded92847f3366d53811abca (diff) | |
download | monitoring-plugins-63897a417917907099b72f4e679890355a7a78a0.tar.gz |
fix the obvious...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1972 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r-- | lib/parse_ini.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/parse_ini.c b/lib/parse_ini.c index e2e5d2c5..aaba03e0 100644 --- a/lib/parse_ini.c +++ b/lib/parse_ini.c | |||
@@ -99,19 +99,19 @@ np_arg_list* np_get_defaults(const char *locator, const char *default_section){ | |||
99 | /* if a file was specified or if we're using the default file */ | 99 | /* if a file was specified or if we're using the default file */ |
100 | if(i.file != NULL && strlen(i.file) > 0){ | 100 | if(i.file != NULL && strlen(i.file) > 0){ |
101 | if(strcmp(i.file, "-")==0){ | 101 | if(strcmp(i.file, "-")==0){ |
102 | inifile=stdout; /* FIXME: Shouldn't it be 'stdin' ??? */ | 102 | inifile=stdin; |
103 | } else { | 103 | } else { |
104 | inifile=fopen(i.file, "r"); | 104 | inifile=fopen(i.file, "r"); |
105 | } | 105 | } |
106 | if(inifile==NULL) die(STATE_UNKNOWN, _("Can't read config file")); | 106 | if(inifile==NULL) die(STATE_UNKNOWN, _("Can't read config file")); |
107 | if(read_defaults(inifile, i.stanza, &defaults)==FALSE && strcmp(i.stanza, default_section) && inifile!=stdout) { /* FIXME: Shouldn't it be 'stdin' ??? */ | 107 | if(read_defaults(inifile, i.stanza, &defaults)==FALSE && strcmp(i.stanza, default_section) && inifile!=stdin) { |
108 | /* We got nothing, try the default section */ | 108 | /* We got nothing, try the default section */ |
109 | rewind(inifile); | 109 | rewind(inifile); |
110 | read_defaults(inifile, default_section, &defaults); | 110 | read_defaults(inifile, default_section, &defaults); |
111 | } | 111 | } |
112 | 112 | ||
113 | free(i.file); | 113 | free(i.file); |
114 | if(inifile!=stdout) fclose(inifile); /* FIXME: Shouldn't it be 'stdin' ??? */ | 114 | if(inifile!=stdin) fclose(inifile); |
115 | } | 115 | } |
116 | free(i.stanza); | 116 | free(i.stanza); |
117 | return defaults; | 117 | return defaults; |