/*
- * "$Id: classes.c,v 1.34.2.10 2003/01/29 20:08:20 mike Exp $"
+ * "$Id: classes.c,v 1.34.2.11 2003/03/10 19:07:17 mike Exp $"
*
* Printer class routines for the Common UNIX Printing System (CUPS).
*
* Add the missing remote printer...
*/
- temp = AddPrinter(value);
- strcpy(temp->make_model, "Remote Printer on unknown");
+ if ((temp = AddPrinter(value)) != NULL)
+ {
+ strcpy(temp->make_model, "Remote Printer on unknown");
- temp->state = IPP_PRINTER_STOPPED;
- temp->type |= CUPS_PRINTER_REMOTE;
- temp->browse_time = 2147483647;
+ temp->state = IPP_PRINTER_STOPPED;
+ temp->type |= CUPS_PRINTER_REMOTE;
+ temp->browse_time = 2147483647;
- SetString(&temp->location, "Location Unknown");
- SetString(&temp->info, "No Information Available");
- temp->hostname[0] = '\0';
+ SetString(&temp->location, "Location Unknown");
+ SetString(&temp->info, "No Information Available");
+ temp->hostname[0] = '\0';
- SetPrinterAttrs(temp);
+ SetPrinterAttrs(temp);
+ }
}
if (temp)
/*
- * End of "$Id: classes.c,v 1.34.2.10 2003/01/29 20:08:20 mike Exp $".
+ * End of "$Id: classes.c,v 1.34.2.11 2003/03/10 19:07:17 mike Exp $".
*/
/*
- * "$Id: printers.c,v 1.93.2.37 2003/02/18 22:43:28 mike Exp $"
+ * "$Id: printers.c,v 1.93.2.38 2003/03/10 19:07:17 mike Exp $"
*
* Printer routines for the Common UNIX Printing System (CUPS).
*
*prev; /* Previous printer in list */
- DEBUG_printf(("AddPrinter(\"%s\")\n", name));
-
/*
* Range check input...
*/
+ LogMessage(L_DEBUG2, "AddPrinter(\"%s\")", name ? name : "(null)");
+
if (name == NULL)
return (NULL);
*/
if ((p = calloc(1, sizeof(printer_t))) == NULL)
+ {
+ LogMessage(L_ERROR, "Unable to allocate memory for printer - %s",
+ strerror(errno));
return (NULL);
+ }
SetString(&p->name, name);
SetString(&p->info, name);
/*
- * End of "$Id: printers.c,v 1.93.2.37 2003/02/18 22:43:28 mike Exp $".
+ * End of "$Id: printers.c,v 1.93.2.38 2003/03/10 19:07:17 mike Exp $".
*/