From: Rasmus Lerdorf Date: Mon, 3 Jun 2002 18:26:27 +0000 (+0000) Subject: Make sure len is defined here X-Git-Tag: RELEASE_0_90~45 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca9c4270f8fdb449e78641967ddeef60e310c9d4;p=php Make sure len is defined here --- diff --git a/ext/standard/html.c b/ext/standard/html.c index cf933df0a1..12eafcde6f 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -526,7 +526,7 @@ static enum entity_charset determine_charset(char *charset_hint) { int i; enum entity_charset charset = cs_8859_1; - int len; + int len = 0; /* Guarantee default behaviour for backwards compatibility */ if (charset_hint == NULL) @@ -573,6 +573,7 @@ static enum entity_charset determine_charset(char *charset_hint) #endif } if (charset_hint) { + if(!len) len = strlen(charset_hint); /* now walk the charset map and look for the codeset */ for (i = 0; charset_map[i].codeset; i++) { if (strncasecmp(charset_hint, charset_map[i].codeset, len) == 0) {