]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
lpoptions crashed when adding or removing options when there were no printers
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sat, 17 Mar 2007 17:06:42 +0000 (17:06 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sat, 17 Mar 2007 17:06:42 +0000 (17:06 +0000)
(STR #2295)

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@6343 7a7537e8-13f0-0310-91df-b6672ffda945

systemv/lpoptions.c

index 6e93720405e9e3102612f0c8ac5e0217ff707c21..4ee39fb14cf88d80a21a302cbe82ff405477a7d8 100644 (file)
@@ -174,6 +174,9 @@ main(int  argc,                             /* I - Number of command-line arguments */
              if ((dest = cupsGetDest(NULL, NULL, num_dests, dests)) == NULL)
                dest = dests;
 
+             if (dest == NULL)
+               _cupsLangPuts(stderr, _("lpoptions: No printers!?!\n"));
+
              for (j = 0; j < dest->num_options; j ++)
                if (cupsGetOption(dest->options[j].name, num_options, options) == NULL)
                  num_options = cupsAddOption(dest->options[j].name,
@@ -244,6 +247,9 @@ main(int  argc,                             /* I - Number of command-line arguments */
              if ((dest = cupsGetDest(NULL, NULL, num_dests, dests)) == NULL)
                dest = dests;
 
+             if (dest == NULL)
+               _cupsLangPuts(stderr, _("lpoptions: No printers!?!\n"));
+
              for (j = 0; j < dest->num_options; j ++)
                if (cupsGetOption(dest->options[j].name, num_options, options) == NULL)
                  num_options = cupsAddOption(dest->options[j].name,