sterling                Fri Mar 12 11:36:31 2004 EDT

  Modified files:              
    /php-src/ext/curl   interface.c 
  Log:
  leave length as -1, no need to strdup()
  
  
http://cvs.php.net/diff.php/php-src/ext/curl/interface.c?r1=1.37&r2=1.38&ty=u
Index: php-src/ext/curl/interface.c
diff -u php-src/ext/curl/interface.c:1.37 php-src/ext/curl/interface.c:1.38
--- php-src/ext/curl/interface.c:1.37   Fri Mar 12 11:28:28 2004
+++ php-src/ext/curl/interface.c        Fri Mar 12 11:36:30 2004
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: interface.c,v 1.37 2004/03/12 16:28:28 john Exp $ */
+/* $Id: interface.c,v 1.38 2004/03/12 16:36:30 sterling Exp $ */
 
 #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
 
@@ -467,7 +467,6 @@
                        zval  *zfd = NULL;
                        zval  *zlength = NULL;
                        zval  *retval_ptr;
-                       int   length;
                        int   error;
                        zend_fcall_info fci;
                        TSRMLS_FETCH_FROM_CTX(ch->thread_ctx);
@@ -499,13 +498,10 @@
                        error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC);
                        if (error == FAILURE) {
                                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot 
call the CURLOPT_READFUNCTION"); 
-                               length = -1;
                        } else {
-                               if(Z_TYPE_P(retval_ptr) == IS_STRING) {
+                               if (Z_TYPE_P(retval_ptr) == IS_STRING) {
                                        memcpy(data, Z_STRVAL_P(retval_ptr), size * 
nmemb);
                                        length = Z_STRLEN_P(retval_ptr);
-                               } else {
-                                       data = strdup("");
                                }
                        }
 

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

Reply via email to