From: Antony Dovgal Date: Wed, 27 Sep 2006 08:31:35 +0000 (+0000) Subject: fix #38961 (metaphone() results in segmentation fault on NetBSD) X-Git-Tag: RELEASE_1_0_0RC1~1539 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d0a747e93763fe720fdd787d7a374abd52b9bab2;p=php fix #38961 (metaphone() results in segmentation fault on NetBSD) --- diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c index 6ba00cf151..86e96f9a58 100644 --- a/ext/standard/metaphone.c +++ b/ext/standard/metaphone.c @@ -25,7 +25,7 @@ #include "php.h" #include "php_metaphone.h" -static int metaphone(char *word, int word_len, long max_phonemes, char **phoned_word, int traditional); +static int metaphone(unsigned char *word, int word_len, long max_phonemes, char **phoned_word, int traditional); /* {{{ proto string metaphone(string text[, int phones]) Break english phrases down into their phonemes */ @@ -41,7 +41,7 @@ PHP_FUNCTION(metaphone) return; } - if (metaphone(str, str_len, phones, &result, 1) == 0) { + if (metaphone((unsigned char *)str, str_len, phones, &result, 1) == 0) { RETVAL_STRING(result, 0); } else { if (result) { @@ -159,7 +159,7 @@ static char Lookahead(char *word, int how_far) /* {{{ metaphone */ -static int metaphone(char *word, int word_len, long max_phonemes, char **phoned_word, int traditional) +static int metaphone(unsigned char *word, int word_len, long max_phonemes, char **phoned_word, int traditional) { int w_idx = 0; /* point in the phonization we're at. */ int p_idx = 0; /* end of the phoned phrase */