patch-pre2.0.14-final2.0 linux/kernel/sysctl.c

Next file: linux/mm/kmalloc.c
Previous file: linux/kernel/printk.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file pre2.0.14/linux/kernel/sysctl.c linux/kernel/sysctl.c
@@ -526,15 +526,13 @@
 		((char *) table->data)[len] = 0;
 		filp->f_pos += *lenp;
 	} else {
-		len = strlen(table->data) + 1;
+		len = strlen(table->data);
 		if (len > table->maxlen)
 			len = table->maxlen;
 		if (len > *lenp)
 			len = *lenp;
-		if (len) {			
-			memcpy_tofs(buffer, table->data, len-1);
-			put_user(0, ((char *) buffer) + len - 1);
-		}
+		if (len)
+			memcpy_tofs(buffer, table->data, len);
 		if (len < *lenp) {
 			put_user('\n', ((char *) buffer) + len);
 			len++;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this