[hackers] [sbase] uuencode: style: just use pointer *b || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Tue, 1 Mar 2016 16:24:36 +0100 (CET)

commit fa18379a055ab2778081d1942489b11bd4df1ee9
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
AuthorDate: Tue Mar 1 12:43:51 2016 +0100
Commit: sin <sin_AT_2f30.org>
CommitDate: Tue Mar 1 15:24:32 2016 +0000

    uuencode: style: just use pointer *b
    
    it doesn't make sense to use b[2] here anyway, and it is incorrect (should be b[3]).

diff --git a/uuencode.c b/uuencode.c
index 8b2f8df..b531720 100644
--- a/uuencode.c
+++ b/uuencode.c
_AT_@ -7,10 +7,9 @@
 #include "util.h"
 
 static unsigned int
-b64e(unsigned char b[2])
+b64e(unsigned char *b)
 {
- unsigned int o = 0;
- unsigned int p = b[2] | (b[1] << 8) | (b[0] << 16);
+ unsigned int o, p = b[2] | (b[1] << 8) | (b[0] << 16);
         const char b64et[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 
         o = b64et[p & 0x3f]; p >>= 6;
Received on Tue Mar 01 2016 - 16:24:36 CET

This archive was generated by hypermail 2.3.0 : Tue Mar 01 2016 - 16:36:16 CET