[monitoring-plugins] lib/parse_ini.c: Cosmetic change

Holger Weiss git at monitoring-plugins.org
Wed Jun 18 23:20:08 CEST 2014


 Module: monitoring-plugins
 Branch: master
 Commit: b81c10e00cc71bf1be90510114e410ed691dc266
 Author: Holger Weiss <holger at zedat.fu-berlin.de>
   Date: Wed Jun 18 23:09:02 2014 +0200
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=b81c10e

lib/parse_ini.c: Cosmetic change

Replace an "if" with the ternary operator.

---

 lib/parse_ini.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lib/parse_ini.c b/lib/parse_ini.c
index cd3d827..30b79d7 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)
 	np_ini_info i;
 
 	parse_locator(locator, default_section, &i);
-	if (strcmp(i.file, "-") == 0)
-		inifile = stdin;
-	else
-		inifile = fopen(i.file, "r");
+	inifile = strcmp(i.file, "-") == 0 ? stdin : fopen(i.file, "r");
 
 	if (inifile == NULL)
 		die(STATE_UNKNOWN, "%s\n", _("Can't read config file"));



More information about the Commits mailing list