projects
/
project
/
uhttpd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fc2a91f
)
change uh_b64decode to take a void pointer to avoid redundant signed/unsigned casts
author
Felix Fietkau
<nbd@openwrt.org>
Wed, 2 Jan 2013 13:35:35 +0000
(14:35 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Wed, 2 Jan 2013 13:35:35 +0000
(14:35 +0100)
utils.c
patch
|
blob
|
history
utils.h
patch
|
blob
|
history
diff --git
a/utils.c
b/utils.c
index
e3de061
..
d2ad296
100644
(file)
--- a/
utils.c
+++ b/
utils.c
@@
-147,16
+147,17
@@
int uh_urlencode(char *buf, int blen, const char *src, int slen)
return (i == slen) ? len : -1;
}
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;
unsigned int cout = 0;
unsigned int cin = 0;
int len = 0;
int i = 0;
- for (i = 0; (i <= slen) && (s
rc
[i] != 0); i++)
+ for (i = 0; (i <= slen) && (s
tr
[i] != 0); i++)
{
{
- cin = s
rc
[i];
+ cin = s
tr
[i];
if ((cin >= '0') && (cin <= '9'))
cin = cin - '0' + 52;
if ((cin >= '0') && (cin <= '9'))
cin = cin - '0' + 52;
diff --git
a/utils.h
b/utils.h
index
0853943
..
8f67823
100644
(file)
--- a/
utils.h
+++ b/
utils.h
@@
-54,7
+54,7
@@
static inline void clearenv(void)
int uh_urldecode(char *buf, int blen, const char *src, int slen);
int uh_urlencode(char *buf, int blen, const char *src, int slen);
int uh_urldecode(char *buf, int blen, const char *src, int slen);
int uh_urlencode(char *buf, int blen, const char *src, int slen);
-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);
bool uh_path_match(const char *prefix, const char *url);
char *uh_split_header(char *str);
bool uh_path_match(const char *prefix, const char *url);
char *uh_split_header(char *str);