diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-01-02 14:35:35 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-01-02 14:35:35 +0100 |
commit | d0aab7b1fc7c94c3d6d41990e7615be85b58e640 (patch) | |
tree | 51babde8a8c85ec006b3588d05a4f9f74a37afc6 /utils.c | |
parent | fc2a91f6761a39d735174af3e9523af079ae3f16 (diff) |
change uh_b64decode to take a void pointer to avoid redundant signed/unsigned casts
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -147,16 +147,17 @@ int uh_urlencode(char *buf, int blen, const char *src, int slen) return (i == slen) ? len : -1; } -int uh_b64decode(char *buf, int blen, const unsigned char *src, int slen) +int uh_b64decode(char *buf, int blen, const void *src, int slen) { + const unsigned char *str = src; unsigned int cout = 0; unsigned int cin = 0; int len = 0; int i = 0; - for (i = 0; (i <= slen) && (src[i] != 0); i++) + for (i = 0; (i <= slen) && (str[i] != 0); i++) { - cin = src[i]; + cin = str[i]; if ((cin >= '0') && (cin <= '9')) cin = cin - '0' + 52; |