stas            Thu Mar  8 09:11:57 2001 EDT

  Modified files:              
    /php4/ext/recode    recode.c 
  Log:
  Better use buffer_to_buffer, since zval is really buffer, not string (it can 
  contain \0's and not end in \0).
  # and recode_string is recode_buffer_to_buffer internally anyways
  
  
Index: php4/ext/recode/recode.c
diff -u php4/ext/recode/recode.c:1.11 php4/ext/recode/recode.c:1.12
--- php4/ext/recode/recode.c:1.11       Sat Jul 15 09:09:18 2000
+++ php4/ext/recode/recode.c    Thu Mar  8 09:11:57 2001
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
  
-/* $Id: recode.c,v 1.11 2000/07/15 16:09:18 eschmid Exp $ */
+/* $Id: recode.c,v 1.12 2001/03/08 17:11:57 stas Exp $ */
 
 /* {{{ includes & prototypes */
 
@@ -96,7 +96,7 @@
 
        php_info_print_table_start();
        php_info_print_table_row(2, "Recode Support", "enabled");
-       php_info_print_table_row(2, "Revision", "$Revision: 1.11 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.12 $");
        php_info_print_table_end();
 
 }
@@ -111,6 +111,7 @@
        pval **str;
        pval **req;
        bool success;
+       int r_len=0, r_alen =0;
        
        ReSLS_FETCH();
        if (ZEND_NUM_ARGS() != 2
@@ -132,13 +133,13 @@
                goto error_exit;
        }
        
-       r = recode_string(request, (*str)->value.str.val);
+       recode_buffer_to_buffer(request, Z_STRVAL_PP(str), Z_STRLEN_PP(str), &r, 
+&r_len, &r_alen);
        if (!r) {
                php_error(E_WARNING, "Recoding failed.");
                goto error_exit;
        }
        
-       RETVAL_STRING(r, 1);
+       RETVAL_STRINGL(r, r_len, 1);
        free(r);
        /* FALLTHROUGH */
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to