]> granicus.if.org Git - php/commitdiff
fix to reiterate that one should _always_ use braces around if/else/for/while
authorStig Bakken <ssb@php.net>
Wed, 21 Jul 1999 14:27:05 +0000 (14:27 +0000)
committerStig Bakken <ssb@php.net>
Wed, 21 Jul 1999 14:27:05 +0000 (14:27 +0000)
ext/standard/base64.c

index 32c63a36c4c82f221f95dfbd62d181c5e642e717..d0a565fde41f8a7978556321a485c189e09bd2eb 100644 (file)
@@ -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;
        }