cvs: /php4/ext/standard base64.c

From: Date: Wed, 21 Jul 1999 14:27:06 +0000
Subject: cvs: /php4/ext/standard base64.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-2423@lists.php.net to get a copy of this message
ssb Wed Jul 21 10:27:06 1999 EDT Modified files: /php4/ext/standard base64.c Log: fix to reiterate that one should _always_ use braces around if/else/for/while Index: php4/ext/standard/base64.c diff -u php4/ext/standard/base64.c:1.7 php4/ext/standard/base64.c:1.8 --- php4/ext/standard/base64.c:1.7 Wed Jul 21 05:02:05 1999 +++ php4/ext/standard/base64.c Wed Jul 21 10:27:05 1999 @@ -15,7 +15,7 @@ | Author: Jim Winstead (jimw@php.net) | +----------------------------------------------------------------------+ */ -/* $Id: base64.c,v 1.7 1999/07/21 09:02:05 sas Exp $ */ +/* $Id: base64.c,v 1.8 1999/07/21 14:27:05 ssb Exp $ */ #include <string.h> @@ -74,18 +74,21 @@ /* 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; }

« previous php.version4 (#2423) next »