shithub: drawterm-fdroid

Download patch

ref: af11a9e1293c2fb4a66ca00c19bc1b6a73d277d5
parent: 17efd16d0f0c57bab790b423c4ca0e01d525f755
author: Russ Cox <rsc@swtch.com>
date: Thu Apr 6 12:21:51 EDT 2006

misparsing 9grid.net

--- a/kern/devip.c
+++ b/kern/devip.c
@@ -689,10 +689,12 @@
 	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 */