shithub: riscv

Download patch

ref: 9898aafa0c1212b6c4aee99cb6b9f8280e88e5af
parent: 8fd222c1575da1fdebc6906799476c953c8f6cf5
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Jul 8 21:32:21 EDT 2018

devip: don't pad the tag for routing commands (fixes removing routes with < 4 character tags)

--- a/sys/src/9/ip/devip.c
+++ b/sys/src/9/ip/devip.c
@@ -260,15 +260,10 @@
 newipaux(char *owner, char *tag)
 {
 	IPaux *a;
-	int n;
 
 	a = smalloc(sizeof(*a));
 	kstrdup(&a->owner, owner);
-	memset(a->tag, ' ', sizeof(a->tag));
-	n = strlen(tag);
-	if(n > sizeof(a->tag))
-		n = sizeof(a->tag);
-	memmove(a->tag, tag, n);
+	strncpy(a->tag, tag, sizeof(a->tag));
 	return a;
 }