Skip to content

Commit 2ab934b

Browse files
committed
fix to reiterate that one should _always_ use braces around if/else/for/while
1 parent 8c63ef0 commit 2ab934b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

ext/standard/base64.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,21 @@ unsigned char *_php3_base64_decode(const unsigned char *string, int length, int
7474
/* this sucks for threaded environments */
7575
static short reverse_table[256];
7676
static int table_built;
77+
unsigned char *result;
7778

78-
if(++table_built == 1) {
79+
if (++table_built == 1) {
7980
char *chp;
8081
for(ch = 0; ch < 256; ch++) {
8182
chp = strchr(base64_table, ch);
82-
if(chp)
83+
if(chp) {
8384
reverse_table[ch] = chp - base64_table;
84-
else
85+
} else {
8586
reverse_table[ch] = -1;
87+
}
88+
}
8689
}
8790

88-
unsigned char *result = (unsigned char *)emalloc((length / 4 * 3 + 1) * sizeof(char));
91+
result = (unsigned char *)emalloc((length / 4 * 3 + 1) * sizeof(char));
8992
if (result == NULL) {
9093
return NULL;
9194
}

0 commit comments

Comments
 (0)