missed some funcs, refactored

This commit is contained in:
Jess Lovelace
2022-02-02 17:51:23 -05:00
parent 4849deb156
commit 062414d13c

View File

@@ -46,7 +46,7 @@ static const struct {
char * char *
lpt_device_get_name(int id) lpt_device_get_name(int id)
{ {
if (strlen((char *) lpt_devices[id].internal_name) == 0) if (strlen((char *) lpt_devices[id].device->internal_name) == 0)
return NULL; return NULL;
if (!lpt_devices[id].device) if (!lpt_devices[id].device)
return "None"; return "None";
@@ -57,9 +57,9 @@ lpt_device_get_name(int id)
char * char *
lpt_device_get_internal_name(int id) lpt_device_get_internal_name(int id)
{ {
if (strlen((char *) lpt_devices[id].internal_name) == 0) if (strlen((char *) lpt_devices[id].device->internal_name) == 0)
return NULL; return NULL;
return (char *) lpt_devices[id].internal_name; return (char *) lpt_devices[id].device->internal_name;
} }
@@ -68,8 +68,8 @@ lpt_device_get_from_internal_name(char *s)
{ {
int c = 0; int c = 0;
while (strlen((char *) lpt_devices[c].internal_name) != 0) { while (strlen((char *) lpt_devices[c].device->internal_name) != 0) {
if (strcmp(lpt_devices[c].internal_name, s) == 0) if (strcmp(lpt_devices[c].device->internal_name, s) == 0)
return c; return c;
c++; c++;
} }