summaryrefslogtreecommitdiff
path: root/coreutils/uudecode.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2007-01-20 21:29:32 +0000
committerBernhard Reutner-Fischer2007-01-20 21:29:32 +0000
commitca5b35299e2513e704a6a6cc2f1ac4e650c3b2de (patch)
treecaccda19ce4af610e88a4f28a3d0362286252ad6 /coreutils/uudecode.c
parentd58c19479d4459923a36c94e5d0c94e8f40b7fd6 (diff)
downloadbusybox-ca5b35299e2513e704a6a6cc2f1ac4e650c3b2de.zip
busybox-ca5b35299e2513e704a6a6cc2f1ac4e650c3b2de.tar.gz
- make read_stduu() and read_base64() void, small size tweaks
Diffstat (limited to 'coreutils/uudecode.c')
-rw-r--r--coreutils/uudecode.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c
index dc7d2ae..92272a9 100644
--- a/coreutils/uudecode.c
+++ b/coreutils/uudecode.c
@@ -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 @@ static int read_stduu(FILE *src_stream, FILE *dst_stream)
char *line_ptr = line;
if (strcmp(line, "end") == 0) {
- return EXIT_SUCCESS;
+ return;
}
length = ((*line_ptr - 0x20) & 0x3f)* 4 / 3;
@@ -66,11 +66,11 @@ static int read_stduu(FILE *src_stream, FILE *dst_stream)
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 @@ static int read_base64(FILE *src_stream, FILE *dst_stream)
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 @@ int uudecode_main(int argc, char **argv)
/* 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 @@ int uudecode_main(int argc, char **argv)
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");
}