Explorar o código

lib/parse_ini.c: Cosmetic change

Replace an "if" with the ternary operator.
Holger Weiss %!s(int64=12) %!d(string=hai) anos
pai
achega
b81c10e00c
Modificáronse 1 ficheiros con 1 adicións e 4 borrados
  1. 1 4
      lib/parse_ini.c

+ 1 - 4
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"));