[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] [PATCH] /kern files missing end of line



On 30/12/2012 23:45, Alan Hourihane wrote:
No good reason as far as I know.

Here is my patch. Please apply.

eol.patch
Added missing \n in /kern/hz and /kern/sysdir. Contributed by Vincent Riviere.

--
Vincent Rivière
--- freemint.orig/sys/kernget.c	2012-12-31 13:32:11.596253800 +0100
+++ freemint/sys/kernget.c	2012-12-31 14:18:54.908753800 +0100
@@ -284,8 +284,7 @@
 	if (!info)
 		return ENOMEM;
 
-	ksprintf (info->buf, len, "%lu", HZ);
-	info->len = strlen(info->buf);
+	info->len = ksprintf (info->buf, len, "%lu\n", HZ);
 
 	*buffer = info;
 	return 0;
@@ -472,14 +471,13 @@
 	SIZEBUF *info;
 	ulong len;
 
-	len = strlen(sysdir) + 1;
+	len = strlen(sysdir) + 2;
 
 	info = kmalloc (sizeof (*info) + len);
 	if (!info)
 		return ENOMEM;
 
-	strcpy (info->buf, sysdir);
-	info->len = strlen(info->buf);
+	info->len = ksprintf (info->buf, len, "%s\n", sysdir);
 
 	*buffer = info;
 	return 0;