summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2014-06-18 23:09:02 +0200
committerHolger Weiss <holger@zedat.fu-berlin.de>2014-06-18 23:09:02 +0200
commitb81c10e00cc71bf1be90510114e410ed691dc266 (patch)
tree413d200dd09da191ea1cb17ec256c15b073748b2 /lib
parent91d04ad62d5272dd0e0e76af80e86ef912a3f643 (diff)
downloadmonitoring-plugins-b81c10e00cc71bf1be90510114e410ed691dc266.tar.gz
lib/parse_ini.c: Cosmetic change
Replace an "if" with the ternary operator.
Diffstat (limited to 'lib')
-rw-r--r--lib/parse_ini.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/parse_ini.c b/lib/parse_ini.c
index cd3d8271..30b79d74 100644
--- a/lib/parse_ini.c
+++ b/lib/parse_ini.c
@@ -120,10 +120,7 @@ np_get_defaults(const char *locator, const char *default_section)
120 np_ini_info i; 120 np_ini_info i;
121 121
122 parse_locator(locator, default_section, &i); 122 parse_locator(locator, default_section, &i);
123 if (strcmp(i.file, "-") == 0) 123 inifile = strcmp(i.file, "-") == 0 ? stdin : fopen(i.file, "r");
124 inifile = stdin;
125 else
126 inifile = fopen(i.file, "r");
127 124
128 if (inifile == NULL) 125 if (inifile == NULL)
129 die(STATE_UNKNOWN, "%s\n", _("Can't read config file")); 126 die(STATE_UNKNOWN, "%s\n", _("Can't read config file"));