
From: Andre McCurdy <armcc2000@yahoo.com>

There is some inconsistency within lib/inflate.c and its users about
whether the error message text or the error() function should provide
the '\n'.

This patch tries to make everyone consistent - by removing the
newline from all message texts, and adding one to the only error()
function which did not provide it (in init/do_mounts_rd.c).



 arch/alpha/boot/misc.c                    |    6 +++---
 arch/arm/boot/compressed/misc.c           |    6 +++---
 arch/arm26/boot/compressed/misc.c         |    6 +++---
 arch/cris/arch-v10/boot/compressed/misc.c |    2 +-
 arch/i386/boot/compressed/misc.c          |   16 ++++++++--------
 arch/i386/boot98/compressed/misc.c        |   16 ++++++++--------
 arch/sh/boot/compressed/misc.c            |    8 ++++----
 arch/x86_64/boot/compressed/misc.c        |   16 ++++++++--------
 init/do_mounts_rd.c                       |    4 ++--
 lib/inflate.c                             |   10 +++++-----
 10 files changed, 45 insertions(+), 45 deletions(-)

diff -puN arch/alpha/boot/misc.c~inflate-error-cleanup arch/alpha/boot/misc.c
--- 25/arch/alpha/boot/misc.c~inflate-error-cleanup	2003-09-07 11:45:25.000000000 -0700
+++ 25-akpm/arch/alpha/boot/misc.c	2003-09-07 11:45:25.000000000 -0700
@@ -106,8 +106,8 @@ static void *malloc(int size)
 {
 	void *p;
 
-	if (size <0) error("Malloc error\n");
-	if (free_mem_ptr <= 0) error("Memory error\n");
+	if (size <0) error("Malloc error");
+	if (free_mem_ptr <= 0) error("Memory error");
 
 	free_mem_ptr = (free_mem_ptr + 3) & ~3;	/* Align */
 
@@ -140,7 +140,7 @@ static void gzip_release(void **ptr)
 int fill_inbuf(void)
 {
 	if (insize != 0)
-		error("ran out of input data\n");
+		error("ran out of input data");
 
 	inbuf = input_data;
 	insize = input_data_size;
diff -puN arch/arm26/boot/compressed/misc.c~inflate-error-cleanup arch/arm26/boot/compressed/misc.c
--- 25/arch/arm26/boot/compressed/misc.c~inflate-error-cleanup	2003-09-07 11:45:25.000000000 -0700
+++ 25-akpm/arch/arm26/boot/compressed/misc.c	2003-09-07 11:45:25.000000000 -0700
@@ -191,8 +191,8 @@ static void *malloc(int size)
 {
 	void *p;
 
-	if (size <0) error("Malloc error\n");
-	if (free_mem_ptr <= 0) error("Memory error\n");
+	if (size <0) error("Malloc error");
+	if (free_mem_ptr <= 0) error("Memory error");
 
 	free_mem_ptr = (free_mem_ptr + 3) & ~3;	/* Align */
 
@@ -236,7 +236,7 @@ static void gzip_release(void **ptr)
 int fill_inbuf(void)
 {
 	if (insize != 0)
-		error("ran out of input data\n");
+		error("ran out of input data");
 
 	inbuf = input_data;
 	insize = &input_data_end[0] - &input_data[0];
diff -puN arch/arm/boot/compressed/misc.c~inflate-error-cleanup arch/arm/boot/compressed/misc.c
--- 25/arch/arm/boot/compressed/misc.c~inflate-error-cleanup	2003-09-07 11:45:25.000000000 -0700
+++ 25-akpm/arch/arm/boot/compressed/misc.c	2003-09-07 11:45:25.000000000 -0700
@@ -191,8 +191,8 @@ static void *malloc(int size)
 {
 	void *p;
 
-	if (size <0) error("Malloc error\n");
-	if (free_mem_ptr <= 0) error("Memory error\n");
+	if (size <0) error("Malloc error");
+	if (free_mem_ptr <= 0) error("Memory error");
 
 	free_mem_ptr = (free_mem_ptr + 3) & ~3;	/* Align */
 
@@ -236,7 +236,7 @@ static void gzip_release(void **ptr)
 int fill_inbuf(void)
 {
 	if (insize != 0)
-		error("ran out of input data\n");
+		error("ran out of input data");
 
 	inbuf = input_data;
 	insize = &input_data_end[0] - &input_data[0];
diff -puN arch/cris/arch-v10/boot/compressed/misc.c~inflate-error-cleanup arch/cris/arch-v10/boot/compressed/misc.c
--- 25/arch/cris/arch-v10/boot/compressed/misc.c~inflate-error-cleanup	2003-09-07 11:45:25.000000000 -0700
+++ 25-akpm/arch/cris/arch-v10/boot/compressed/misc.c	2003-09-07 11:45:25.000000000 -0700
@@ -115,7 +115,7 @@ static void *malloc(int size)
 {
 	void *p;
 
-	if (size <0) error("Malloc error\n");
+	if (size <0) error("Malloc error");
 
 	free_mem_ptr = (free_mem_ptr + 3) & ~3;	/* Align */
 
diff -puN arch/i386/boot98/compressed/misc.c~inflate-error-cleanup arch/i386/boot98/compressed/misc.c
--- 25/arch/i386/boot98/compressed/misc.c~inflate-error-cleanup	2003-09-07 11:45:25.000000000 -0700
+++ 25-akpm/arch/i386/boot98/compressed/misc.c	2003-09-07 11:45:25.000000000 -0700
@@ -132,8 +132,8 @@ static void *malloc(int size)
 {
 	void *p;
 
-	if (size <0) error("Malloc error\n");
-	if (free_mem_ptr <= 0) error("Memory error\n");
+	if (size <0) error("Malloc error");
+	if (free_mem_ptr <= 0) error("Memory error");
 
 	free_mem_ptr = (free_mem_ptr + 3) & ~3;	/* Align */
 
@@ -141,7 +141,7 @@ static void *malloc(int size)
 	free_mem_ptr += size;
 
 	if (free_mem_ptr >= free_mem_end_ptr)
-		error("\nOut of memory\n");
+		error("Out of memory");
 
 	return p;
 }
@@ -232,7 +232,7 @@ static void* memcpy(void* __dest, __cons
 static int fill_inbuf(void)
 {
 	if (insize != 0) {
-		error("ran out of input data\n");
+		error("ran out of input data");
 	}
 
 	inbuf = input_data;
@@ -306,9 +306,9 @@ struct {
 static void setup_normal_output_buffer(void)
 {
 #ifdef STANDARD_MEMORY_BIOS_CALL
-	if (EXT_MEM_K < 1024) error("Less than 2MB of memory.\n");
+	if (EXT_MEM_K < 1024) error("Less than 2MB of memory");
 #else
-	if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < 1024) error("Less than 2MB of memory.\n");
+	if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < 1024) error("Less than 2MB of memory");
 #endif
 	output_data = (char *)0x100000; /* Points to 1M */
 	free_mem_end_ptr = (long)real_mode;
@@ -323,9 +323,9 @@ static void setup_output_buffer_if_we_ru
 {
 	high_buffer_start = (uch *)(((ulg)&end) + HEAP_SIZE);
 #ifdef STANDARD_MEMORY_BIOS_CALL
-	if (EXT_MEM_K < (3*1024)) error("Less than 4MB of memory.\n");
+	if (EXT_MEM_K < (3*1024)) error("Less than 4MB of memory");
 #else
-	if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < (3*1024)) error("Less than 4MB of memory.\n");
+	if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < (3*1024)) error("Less than 4MB of memory");
 #endif	
 	mv->low_buffer_start = output_data = (char *)LOW_BUFFER_START;
 	low_buffer_end = ((unsigned int)real_mode > LOW_BUFFER_MAX
diff -puN arch/i386/boot/compressed/misc.c~inflate-error-cleanup arch/i386/boot/compressed/misc.c
--- 25/arch/i386/boot/compressed/misc.c~inflate-error-cleanup	2003-09-07 11:45:25.000000000 -0700
+++ 25-akpm/arch/i386/boot/compressed/misc.c	2003-09-07 11:45:25.000000000 -0700
@@ -132,8 +132,8 @@ static void *malloc(int size)
 {
 	void *p;
 
-	if (size <0) error("Malloc error\n");
-	if (free_mem_ptr <= 0) error("Memory error\n");
+	if (size <0) error("Malloc error");
+	if (free_mem_ptr <= 0) error("Memory error");
 
 	free_mem_ptr = (free_mem_ptr + 3) & ~3;	/* Align */
 
@@ -141,7 +141,7 @@ static void *malloc(int size)
 	free_mem_ptr += size;
 
 	if (free_mem_ptr >= free_mem_end_ptr)
-		error("\nOut of memory\n");
+		error("Out of memory");
 
 	return p;
 }
@@ -232,7 +232,7 @@ static void* memcpy(void* __dest, __cons
 static int fill_inbuf(void)
 {
 	if (insize != 0) {
-		error("ran out of input data\n");
+		error("ran out of input data");
 	}
 
 	inbuf = input_data;
@@ -306,9 +306,9 @@ struct {
 static void setup_normal_output_buffer(void)
 {
 #ifdef STANDARD_MEMORY_BIOS_CALL
-	if (EXT_MEM_K < 1024) error("Less than 2MB of memory.\n");
+	if (EXT_MEM_K < 1024) error("Less than 2MB of memory");
 #else
-	if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < 1024) error("Less than 2MB of memory.\n");
+	if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < 1024) error("Less than 2MB of memory");
 #endif
 	output_data = (char *)0x100000; /* Points to 1M */
 	free_mem_end_ptr = (long)real_mode;
@@ -323,9 +323,9 @@ static void setup_output_buffer_if_we_ru
 {
 	high_buffer_start = (uch *)(((ulg)&end) + HEAP_SIZE);
 #ifdef STANDARD_MEMORY_BIOS_CALL
-	if (EXT_MEM_K < (3*1024)) error("Less than 4MB of memory.\n");
+	if (EXT_MEM_K < (3*1024)) error("Less than 4MB of memory");
 #else
-	if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < (3*1024)) error("Less than 4MB of memory.\n");
+	if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < (3*1024)) error("Less than 4MB of memory");
 #endif	
 	mv->low_buffer_start = output_data = (char *)LOW_BUFFER_START;
 	low_buffer_end = ((unsigned int)real_mode > LOW_BUFFER_MAX
diff -puN arch/sh/boot/compressed/misc.c~inflate-error-cleanup arch/sh/boot/compressed/misc.c
--- 25/arch/sh/boot/compressed/misc.c~inflate-error-cleanup	2003-09-07 11:45:25.000000000 -0700
+++ 25-akpm/arch/sh/boot/compressed/misc.c	2003-09-07 11:45:25.000000000 -0700
@@ -105,8 +105,8 @@ static void *malloc(int size)
 {
 	void *p;
 
-	if (size <0) error("Malloc error\n");
-	if (free_mem_ptr == 0) error("Memory error\n");
+	if (size <0) error("Malloc error");
+	if (free_mem_ptr == 0) error("Memory error");
 
 	free_mem_ptr = (free_mem_ptr + 3) & ~3;	/* Align */
 
@@ -114,7 +114,7 @@ static void *malloc(int size)
 	free_mem_ptr += size;
 
 	if (free_mem_ptr >= free_mem_end_ptr)
-		error("\nOut of memory\n");
+		error("Out of memory");
 
 	return p;
 }
@@ -180,7 +180,7 @@ void* memcpy(void* __dest, __const void*
 static int fill_inbuf(void)
 {
 	if (insize != 0) {
-		error("ran out of input data\n");
+		error("ran out of input data");
 	}
 
 	inbuf = input_data;
diff -puN arch/x86_64/boot/compressed/misc.c~inflate-error-cleanup arch/x86_64/boot/compressed/misc.c
--- 25/arch/x86_64/boot/compressed/misc.c~inflate-error-cleanup	2003-09-07 11:45:25.000000000 -0700
+++ 25-akpm/arch/x86_64/boot/compressed/misc.c	2003-09-07 11:45:25.000000000 -0700
@@ -117,8 +117,8 @@ static void *malloc(int size)
 {
 	void *p;
 
-	if (size <0) error("Malloc error\n");
-	if (free_mem_ptr <= 0) error("Memory error\n");
+	if (size <0) error("Malloc error");
+	if (free_mem_ptr <= 0) error("Memory error");
 
 	free_mem_ptr = (free_mem_ptr + 3) & ~3;	/* Align */
 
@@ -126,7 +126,7 @@ static void *malloc(int size)
 	free_mem_ptr += size;
 
 	if (free_mem_ptr >= free_mem_end_ptr)
-		error("\nOut of memory\n");
+		error("Out of memory");
 
 	return p;
 }
@@ -216,7 +216,7 @@ void* memcpy(void* dest, const void* src
 static int fill_inbuf(void)
 {
 	if (insize != 0) {
-		error("ran out of input data\n");
+		error("ran out of input data");
 	}
 
 	inbuf = input_data;
@@ -281,9 +281,9 @@ static void error(char *x)
 void setup_normal_output_buffer(void)
 {
 #ifdef STANDARD_MEMORY_BIOS_CALL
-	if (EXT_MEM_K < 1024) error("Less than 2MB of memory.\n");
+	if (EXT_MEM_K < 1024) error("Less than 2MB of memory");
 #else
-	if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < 1024) error("Less than 2MB of memory.\n");
+	if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < 1024) error("Less than 2MB of memory");
 #endif
 	output_data = (char *)0x100000; /* Points to 1M */
 	free_mem_end_ptr = (long)real_mode;
@@ -298,9 +298,9 @@ void setup_output_buffer_if_we_run_high(
 {
 	high_buffer_start = (uch *)(((ulg)&end) + HEAP_SIZE);
 #ifdef STANDARD_MEMORY_BIOS_CALL
-	if (EXT_MEM_K < (3*1024)) error("Less than 4MB of memory.\n");
+	if (EXT_MEM_K < (3*1024)) error("Less than 4MB of memory");
 #else
-	if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < (3*1024)) error("Less than 4MB of memory.\n");
+	if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < (3*1024)) error("Less than 4MB of memory");
 #endif	
 	mv->low_buffer_start = output_data = (char *)LOW_BUFFER_START;
 	low_buffer_end = ((unsigned int)real_mode > LOW_BUFFER_MAX
diff -puN init/do_mounts_rd.c~inflate-error-cleanup init/do_mounts_rd.c
--- 25/init/do_mounts_rd.c~inflate-error-cleanup	2003-09-07 11:45:25.000000000 -0700
+++ 25-akpm/init/do_mounts_rd.c	2003-09-07 11:45:25.000000000 -0700
@@ -332,7 +332,7 @@ static int __init fill_inbuf(void)
 	
 	insize = read(crd_infd, inbuf, INBUFSIZ);
 	if (insize == 0) {
-		error("RAMDISK: ran out of compressed data\n");
+		error("RAMDISK: ran out of compressed data");
 		return -1;
 	}
 
@@ -369,7 +369,7 @@ static void __init flush_window(void)
 
 static void __init error(char *x)
 {
-	printk(KERN_ERR "%s", x);
+	printk(KERN_ERR "%s\n", x);
 	exit_code = 1;
 	unzip_error = 1;
 }
diff -puN lib/inflate.c~inflate-error-cleanup lib/inflate.c
--- 25/lib/inflate.c~inflate-error-cleanup	2003-09-07 11:45:25.000000000 -0700
+++ 25-akpm/lib/inflate.c	2003-09-07 11:45:25.000000000 -0700
@@ -871,7 +871,7 @@ DEBG("dyn5a ");
   {
 DEBG("dyn5b ");
     if (i == 1) {
-      error(" incomplete literal tree\n");
+      error("incomplete literal tree");
       huft_free(tl);
     }
     return i;                   /* incomplete code set */
@@ -882,7 +882,7 @@ DEBG("dyn5c ");
   {
 DEBG("dyn5d ");
     if (i == 1) {
-      error(" incomplete distance tree\n");
+      error("incomplete distance tree");
 #ifdef PKZIP_BUG_WORKAROUND
       i = 0;
     }
@@ -1097,15 +1097,15 @@ static int gunzip(void)
 
     flags  = (uch)get_byte();
     if ((flags & ENCRYPTED) != 0) {
-	    error("Input is encrypted\n");
+	    error("Input is encrypted");
 	    return -1;
     }
     if ((flags & CONTINUATION) != 0) {
-	    error("Multi part input\n");
+	    error("Multi part input");
 	    return -1;
     }
     if ((flags & RESERVED) != 0) {
-	    error("Input has invalid flags\n");
+	    error("Input has invalid flags");
 	    return -1;
     }
     (ulg)get_byte();	/* Get timestamp */

_
