svn commit: trunk/busybox/coreutils

aldot at busybox.net aldot at busybox.net
Sat Jan 20 13:29:32 PST 2007


Author: aldot
Date: 2007-01-20 13:29:32 -0800 (Sat, 20 Jan 2007)
New Revision: 17415

Log:
- make read_stduu() and read_base64() void, small size tweaks


Modified:
   trunk/busybox/coreutils/uudecode.c


Changeset:
Modified: trunk/busybox/coreutils/uudecode.c
===================================================================
--- trunk/busybox/coreutils/uudecode.c	2007-01-20 21:28:36 UTC (rev 17414)
+++ trunk/busybox/coreutils/uudecode.c	2007-01-20 21:29:32 UTC (rev 17415)
@@ -14,7 +14,7 @@
 
 #include "busybox.h"
 
-static int read_stduu(FILE *src_stream, FILE *dst_stream)
+static void read_stduu(FILE *src_stream, FILE *dst_stream)
 {
 	char *line;
 
@@ -23,7 +23,7 @@
 		char *line_ptr = line;
 
 		if (strcmp(line, "end") == 0) {
-			return EXIT_SUCCESS;
+			return;
 		}
 		length = ((*line_ptr - 0x20) & 0x3f)* 4 / 3;
 
@@ -66,11 +66,11 @@
 	bb_error_msg_and_die("short file");
 }
 
-static int read_base64(FILE *src_stream, FILE *dst_stream)
+static void read_base64(FILE *src_stream, FILE *dst_stream)
 {
 	static const char base64_table[] =
 		"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n";
-	char term_count = 0;
+	int term_count = 0;
 
 	while (1) {
 		char translated[4];
@@ -101,7 +101,7 @@
 			else if (*table_ptr == '\n') {
 				/* Check for terminating line */
 				if (term_count == 5) {
-					return EXIT_SUCCESS;
+					return;
 				}
 				term_count = 1;
 				continue;
@@ -141,11 +141,10 @@
 
 	/* Search for the start of the encoding */
 	while ((line = xmalloc_getline(src_stream)) != NULL) {
-		int (*decode_fn_ptr)(FILE * src, FILE * dst);
+		void (*decode_fn_ptr)(FILE * src, FILE * dst);
 		char *line_ptr;
 		FILE *dst_stream;
 		int mode;
-		int ret;
 
 		if (strncmp(line, "begin-base64 ", 13) == 0) {
 			line_ptr = line + 13;
@@ -173,9 +172,9 @@
 			chmod(outname, mode & (S_IRWXU | S_IRWXG | S_IRWXO));
 		}
 		free(line);
-		ret = decode_fn_ptr(src_stream, dst_stream);
+		decode_fn_ptr(src_stream, dst_stream);
 		fclose_if_not_stdin(src_stream);
-		return ret;
+		return EXIT_SUCCESS;
 	}
 	bb_error_msg_and_die("no 'begin' line");
 }



More information about the busybox-cvs mailing list