From af11a9e1293c2fb4a66ca00c19bc1b6a73d277d5 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 6 Apr 2006 16:21:51 +0000 Subject: [PATCH] misparsing 9grid.net --- kern/devip.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kern/devip.c b/kern/devip.c index 0642dcf..f192aeb 100644 --- a/kern/devip.c +++ b/kern/devip.c @@ -689,10 +689,12 @@ parseip(char *to, char *from) memset(to, 0, 4); for(i = 0; i < 4 && *p; i++){ to[i] = strtoul(p, &p, 10); + if(*p != '.' && *p != 0){ + memset(to, 0, 4); + return 0; + } if(*p == '.') p++; - if(*p != '.' && *p != 0) - return 0; } switch(CLASS(to)){ case 0: /* class A - 1 byte net */