[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard metaphone.c

2008-02-26 Thread Felipe Pena
felipe  Wed Feb 27 01:10:57 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   metaphone.c 
  Log:
  Improved fix for #44242
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/metaphone.c?r1=1.28.2.1.2.6r2=1.28.2.1.2.7diff_format=u
Index: php-src/ext/standard/metaphone.c
diff -u php-src/ext/standard/metaphone.c:1.28.2.1.2.6 
php-src/ext/standard/metaphone.c:1.28.2.1.2.7
--- php-src/ext/standard/metaphone.c:1.28.2.1.2.6   Mon Feb 25 22:40:45 2008
+++ php-src/ext/standard/metaphone.cWed Feb 27 01:10:56 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: metaphone.c,v 1.28.2.1.2.6 2008/02/25 22:40:45 felipe Exp $ */
+/* $Id: metaphone.c,v 1.28.2.1.2.7 2008/02/27 01:10:56 felipe Exp $ */
 
 /*
Based on CPANs Text-Metaphone-1.96 by Michael G Schwern [EMAIL 
PROTECTED] 
@@ -144,7 +144,7 @@
  * could be one though; or more too). */
 #define Phonize(c) { \
if (p_idx = max_buffer_len) { \
-   *phoned_word = 
erealloc(*phoned_word, max_buffer_len + 2); \
+   *phoned_word = 
safe_erealloc(*phoned_word, 2, sizeof(char), max_buffer_len); \
max_buffer_len += 2; \
} \
(*phoned_word)[p_idx++] = c; \
@@ -152,7 +152,7 @@
 /* Slap a null character on the end of the phoned word */
 #define End_Phoned_Word{ \
if (p_idx == 
max_buffer_len) { \
-   *phoned_word = 
erealloc(*phoned_word, max_buffer_len + 1); \
+   *phoned_word = 
safe_erealloc(*phoned_word, 1, sizeof(char), max_buffer_len); \
} \
(*phoned_word)[p_idx] = 
'\0'; \
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard metaphone.c

2006-09-26 Thread Ilia Alshanetsky
iliaa   Tue Sep 26 15:40:46 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   metaphone.c 
  Log:
  64bit fix (Possible fix for bug #38961)
  
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/metaphone.c?r1=1.28.2.1.2.1r2=1.28.2.1.2.2diff_format=u
Index: php-src/ext/standard/metaphone.c
diff -u php-src/ext/standard/metaphone.c:1.28.2.1.2.1 
php-src/ext/standard/metaphone.c:1.28.2.1.2.2
--- php-src/ext/standard/metaphone.c:1.28.2.1.2.1   Mon Jun 26 18:48:56 2006
+++ php-src/ext/standard/metaphone.cTue Sep 26 15:40:45 2006
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: metaphone.c,v 1.28.2.1.2.1 2006/06/26 18:48:56 bjori Exp $ */
+/* $Id: metaphone.c,v 1.28.2.1.2.2 2006/09/26 15:40:45 iliaa Exp $ */
 
 /*
Based on CPANs Text-Metaphone-1.96 by Michael G Schwern [EMAIL 
PROTECTED] 
@@ -25,9 +25,7 @@
 #include php.h
 #include php_metaphone.h
 
-static int metaphone(char *word, int word_len, int max_phonemes, char 
**phoned_word, int traditional);
-
-PHP_FUNCTION(metaphone);
+static int metaphone(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 */
@@ -161,7 +159,7 @@
 
 /* {{{ metaphone
  */
-static int metaphone(char *word, int word_len, int max_phonemes, char 
**phoned_word, int traditional)
+static int metaphone(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 */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php