summaryrefslogtreecommitdiff
path: root/systemv
diff options
context:
space:
mode:
authorDavieV <davidvalleau@gmail.com>2017-10-25 22:29:01 -0700
committerDavieV <davidvalleau@gmail.com>2017-10-25 22:29:01 -0700
commitf9ee3b81e100f0923574d10adc4bb51e88ccf8df (patch)
treef152afe437c3ef80849facba561c8169d6392e72 /systemv
parent7e50a735a892ad147c23f56f97a442843137e01b (diff)
downloadcups-f9ee3b81e100f0923574d10adc4bb51e88ccf8df.tar.gz
Rearranging order of null checks in lpadmin
Diffstat (limited to 'systemv')
-rw-r--r--systemv/lpadmin.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/systemv/lpadmin.c b/systemv/lpadmin.c
index f9a1970b5..c608c2d30 100644
--- a/systemv/lpadmin.c
+++ b/systemv/lpadmin.c
@@ -601,27 +601,26 @@ main(int argc, /* I - Number of command-line arguments */
if (num_options || file)
{
- if (!http)
- {
- http = httpConnect2(cupsServer(), ippPort(), NULL, AF_UNSPEC, cupsEncryption(), 1, 30000, NULL);
-
- if (http == NULL)
- {
- _cupsLangPrintf(stderr,
- _("lpadmin: Unable to connect to server: %s"),
- strerror(errno));
- return (1);
- }
- }
-
if (printer == NULL)
{
_cupsLangPuts(stderr,
_("lpadmin: Unable to set the printer options:\n"
- " You must specify a printer name first."));
+ " You must specify a printer name first."));
return (1);
}
+ if (!http)
+ {
+ http = httpConnect2(cupsServer(), ippPort(), NULL, AF_UNSPEC,
+ cupsEncryption(), 1, 30000, NULL);
+
+ if (http == NULL) {
+ _cupsLangPrintf(stderr, _("lpadmin: Unable to connect to server: %s"),
+ strerror(errno));
+ return (1);
+ }
+ }
+
if (set_printer_options(http, printer, num_options, options, file))
return (1);
}