- split=strchr(tty, ',');
- if (split != NULL)
- split = '\0';
-
- if (!dev_exist(tty)) {
- DEBUG(4, "skipping %s\n", tty);
- return;
+ if (tty != NULL) {
+ split = strchr(tty, ',');
+ if (split != NULL)
+ *split = '\0';
+
+ if (!dev_exist(tty)) {
+ DEBUG(4, "skipping %s\n", tty);
+ return;
+ }
+
+ console = strdup(tty);
+ a->id = strdup(tty);
+ }
+ else {
+ console = NULL;
+ a->id = NULL;