From ca9c4270f8fdb449e78641967ddeef60e310c9d4 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Mon, 3 Jun 2002 18:26:27 +0000 Subject: [PATCH] Make sure len is defined here --- ext/standard/html.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) { -- 2.50.1