summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Bakken <ssb@php.net>1999-07-21 14:27:05 +0000
committerStig Bakken <ssb@php.net>1999-07-21 14:27:05 +0000
commit2ab934bfc20edbc6442b76c90d214ba24bca3e5c (patch)
tree124055271780d5548e9b5ef94dadc588c65889c9
parent8c63ef0605df97cf3e4a827806ddc50a95e177dd (diff)
downloadphp-git-2ab934bfc20edbc6442b76c90d214ba24bca3e5c.tar.gz
fix to reiterate that one should _always_ use braces around if/else/for/while
-rw-r--r--ext/standard/base64.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/standard/base64.c b/ext/standard/base64.c
index 32c63a36c4..d0a565fde4 100644
--- a/ext/standard/base64.c
+++ b/ext/standard/base64.c
@@ -74,18 +74,21 @@ unsigned char *_php3_base64_decode(const unsigned char *string, int length, int
/* this sucks for threaded environments */
static short reverse_table[256];
static int table_built;
+ unsigned char *result;
- if(++table_built == 1) {
+ if (++table_built == 1) {
char *chp;
for(ch = 0; ch < 256; ch++) {
chp = strchr(base64_table, ch);
- if(chp)
+ if(chp) {
reverse_table[ch] = chp - base64_table;
- else
+ } else {
reverse_table[ch] = -1;
+ }
+ }
}
- unsigned char *result = (unsigned char *)emalloc((length / 4 * 3 + 1) * sizeof(char));
+ result = (unsigned char *)emalloc((length / 4 * 3 + 1) * sizeof(char));
if (result == NULL) {
return NULL;
}