diff options
author | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2006-01-31 14:25:52 +0000 |
---|---|---|
committer | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2006-01-31 14:25:52 +0000 |
commit | 87be316149604ca18613acb1a776ea4ea9f07929 (patch) | |
tree | 8448102664334cc678591c09cb847529e36b0cc4 | |
parent | 4333a09d657348672db61f3063f2d272708c2548 (diff) | |
download | busybox-w32-87be316149604ca18613acb1a776ea4ea9f07929.tar.gz busybox-w32-87be316149604ca18613acb1a776ea4ea9f07929.tar.bz2 busybox-w32-87be316149604ca18613acb1a776ea4ea9f07929.zip |
more better for me signed<->unsigned and the const keyword usage
-rw-r--r-- | coreutils/uudecode.c | 6 | ||||
-rw-r--r-- | coreutils/uuencode.c | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index 60bf7d8c1..5823afd90 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c | |||
@@ -52,13 +52,13 @@ static int read_stduu(FILE *src_stream, FILE *dst_stream) | |||
52 | 52 | ||
53 | line_ptr++; | 53 | line_ptr++; |
54 | /* Tolerate an overly long line to acomadate a possible exta '`' */ | 54 | /* Tolerate an overly long line to acomadate a possible exta '`' */ |
55 | if (strlen(line_ptr) < length) { | 55 | if (strlen(line_ptr) < (size_t)length) { |
56 | bb_error_msg_and_die("Short file"); | 56 | bb_error_msg_and_die("Short file"); |
57 | } | 57 | } |
58 | 58 | ||
59 | while (length > 0) { | 59 | while (length > 0) { |
60 | /* Merge four 6 bit chars to three 8 bit chars */ | 60 | /* Merge four 6 bit chars to three 8 bit chars */ |
61 | fputc(((line_ptr[0] - 0x20) & 077) << 2 | ((line_ptr[1] - 0x20) & 077) >> 4, dst_stream); | 61 | fputc(((line_ptr[0] - 0x20) & 077) << 2 | ((line_ptr[1] - 0x20) & 077) >> 4, dst_stream); |
62 | line_ptr++; | 62 | line_ptr++; |
63 | length--; | 63 | length--; |
64 | if (length == 0) { | 64 | if (length == 0) { |
@@ -83,7 +83,7 @@ static int read_stduu(FILE *src_stream, FILE *dst_stream) | |||
83 | 83 | ||
84 | static int read_base64(FILE *src_stream, FILE *dst_stream) | 84 | static int read_base64(FILE *src_stream, FILE *dst_stream) |
85 | { | 85 | { |
86 | const char *base64_table = | 86 | static const char base64_table[] = |
87 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n"; | 87 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n"; |
88 | char term_count = 0; | 88 | char term_count = 0; |
89 | 89 | ||
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c index ee07b084f..d45565c6e 100644 --- a/coreutils/uuencode.c +++ b/coreutils/uuencode.c | |||
@@ -58,10 +58,10 @@ static const char tbl_std[65] = { | |||
58 | * buffer of at least 1+BASE64_LENGTH(length) bytes. | 58 | * buffer of at least 1+BASE64_LENGTH(length) bytes. |
59 | * where BASE64_LENGTH(len) = (4 * ((LENGTH + 2) / 3)) | 59 | * where BASE64_LENGTH(len) = (4 * ((LENGTH + 2) / 3)) |
60 | */ | 60 | */ |
61 | static void uuencode (const unsigned char *s, const char *store, const int length, const char *tbl) | 61 | static void uuencode (const unsigned char *s, char *store, const int length, const char *tbl) |
62 | { | 62 | { |
63 | int i; | 63 | int i; |
64 | unsigned char *p = (unsigned char *)store; | 64 | char *p = store; |
65 | 65 | ||
66 | /* Transform the 3x8 bits to 4x6 bits, as required by base64. */ | 66 | /* Transform the 3x8 bits to 4x6 bits, as required by base64. */ |
67 | for (i = 0; i < length; i += 3) { | 67 | for (i = 0; i < length; i += 3) { |
@@ -86,9 +86,9 @@ static void uuencode (const unsigned char *s, const char *store, const int lengt | |||
86 | #define DST_BUF_SIZE 4 * ((SRC_BUF_SIZE + 2) / 3) | 86 | #define DST_BUF_SIZE 4 * ((SRC_BUF_SIZE + 2) / 3) |
87 | int uuencode_main(int argc, char **argv) | 87 | int uuencode_main(int argc, char **argv) |
88 | { | 88 | { |
89 | const int src_buf_size = SRC_BUF_SIZE; | 89 | const size_t src_buf_size = SRC_BUF_SIZE; |
90 | const int dst_buf_size = DST_BUF_SIZE; | 90 | const size_t dst_buf_size = DST_BUF_SIZE; |
91 | int write_size = dst_buf_size; | 91 | size_t write_size = dst_buf_size; |
92 | struct stat stat_buf; | 92 | struct stat stat_buf; |
93 | FILE *src_stream = stdin; | 93 | FILE *src_stream = stdin; |
94 | const char *tbl; | 94 | const char *tbl; |