diff options
author | Thomas Osterried <thomas@osterried.de> | 2009-04-09 12:33:52 +0000 |
---|---|---|
committer | Thomas Osterried <thomas@osterried.de> | 2009-04-09 12:33:52 +0000 |
commit | ab92cf5d7b324c53c7a7c2ffbbb8d9b2ec18e722 (patch) | |
tree | 511c4f70f23268e6baae4d52245e9ff87e27532e | |
parent | bd9f68d02864a4e22a8403e6a208769994f41408 (diff) |
small fix for the last patch
-rw-r--r-- | axconfig.c | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -104,10 +104,11 @@ char *ax25_config_get_name(char *device) { AX_Port *p = ax25_ports; - while (p != NULL && p->Device != NULL) { - if (strcmp(p->Device, device) == 0) - return p->Name; - + while (p != NULL) { + if (p->Device != NULL) { + if (strcmp(p->Device, device) == 0) + return p->Name; + } p = p->Next; } @@ -142,12 +143,14 @@ char *ax25_config_get_port(ax25_address *callsign) if (ax25_cmp(callsign, &null_ax25_address) == 0) return "*"; - while (p != NULL && p->Call != NULL) { - ax25_aton_entry(p->Call, (char *)&addr); + while (p != NULL) { + if (p->Call != NULL) { + ax25_aton_entry(p->Call, (char *)&addr); - if (ax25_cmp(callsign, &addr) == 0) - return p->Name; + if (ax25_cmp(callsign, &addr) == 0) + return p->Name; + } p = p->Next; } |