--- /home/ecki/NET-TOOLS/net-tools-1.60.org/lib/interface.c 2001-02-10 20:31:15.000000000 +0100 +++ /home/ecki/NET-TOOLS/net-tools-1.60.org/lib/interface.c 2004-07-30 03:13:37.000000000 +0200 @@ -198,7 +198,7 @@ return err; } -static char *get_name(char *name, char *p) +char *get_name(char *name, char *p) { while (isspace(*p)) p++; @@ -206,16 +206,19 @@ if (isspace(*p)) break; if (*p == ':') { /* could be an alias */ - char *dot = p, *dotname = name; - *name++ = *p++; - while (isdigit(*p)) - *name++ = *p++; - if (*p != ':') { /* it wasn't, backup */ - p = dot; - name = dotname; + char *dot = p++; + while (*p && isdigit(*p)) p++; + if (*p == ':') { + /* Yes it is, backup and copy it. */ + p = dot; + *name++ = *p++; + while (*p && isdigit(*p)) { + *name++ = *p++; + } + } else { + /* No, it isn't */ + p = dot; } - if (*p == '\0') - return NULL; p++; break; }