sniper          Mon Mar 10 18:13:03 2003 EDT

  Modified files:              (Branch: PHP_4_3)
    /php4/ext/pgsql     pgsql.c 
  Log:
  MFH
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.244.2.12 php4/ext/pgsql/pgsql.c:1.244.2.13
--- php4/ext/pgsql/pgsql.c:1.244.2.12   Sun Mar  9 14:15:16 2003
+++ php4/ext/pgsql/pgsql.c      Mon Mar 10 18:13:03 2003
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
  */
  
-/* $Id: pgsql.c,v 1.244.2.12 2003/03/09 19:15:16 derick Exp $ */
+/* $Id: pgsql.c,v 1.244.2.13 2003/03/10 23:13:03 sniper Exp $ */
 
 #include <stdlib.h>
 
@@ -997,7 +997,7 @@
 #if HAVE_PQCMDTUPLES
                        Z_LVAL_P(return_value) = atoi(PQcmdTuples(pgsql_result));
 #else
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supportted 
under this build.");
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supported 
under this build.");
                        Z_LVAL_P(return_value) = 0;
 #endif
                        break;
@@ -1727,7 +1727,7 @@
        zval *pgsql_link = NULL;
        long oid_long;
        char *oid_string, *end_ptr;
-       size_t oid_strlen;
+       int oid_strlen;
        PGconn *pgsql;
        Oid oid;
        int id = -1;
@@ -1794,7 +1794,7 @@
        zval *pgsql_link = NULL;
        long oid_long;
        char *oid_string, *end_ptr, *mode_string;
-       size_t oid_strlen, mode_strlen;
+       int oid_strlen, mode_strlen;
        PGconn *pgsql;
        Oid oid;
        int id = -1, pgsql_mode=0, pgsql_lofd;
@@ -2099,7 +2099,7 @@
 {
        zval *pgsql_link = NULL;
        char *file_out, *oid_string, *end_ptr;
-       size_t oid_strlen;
+       int oid_strlen;
        int id = -1, name_len;
        long oid_long;
        Oid oid;
@@ -2442,9 +2442,7 @@
                case PGRES_COPY_OUT:
                        if (pgsql_result) {
                                PQclear(pgsql_result);
-                               if (array_init(return_value) == FAILURE) {
-                                       RETURN_FALSE;
-                               }
+                               array_init(return_value);
                                while (!copydone)
                                {
                                        if ((ret = PQgetline(pgsql, copybuf, 
COPYBUFSIZ))) {
@@ -2601,8 +2599,8 @@
 PHP_FUNCTION(pg_escape_string)
 {
        char *from = NULL, *to = NULL;
-       size_t to_len;
-       long from_len;
+       int to_len;
+       int from_len;
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
                                                          &from, &from_len) == 
FAILURE) {
                return;
@@ -2620,7 +2618,7 @@
 {
        char *from = NULL, *to = NULL;
        size_t to_len;
-       long from_len;
+       int from_len;
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
                                                          &from, &from_len) == 
FAILURE) {
                return;
@@ -2668,8 +2666,6 @@
        buflen = strlen(strtext);       /* will shrink, also we discover if
                                                                 * strtext */
        buffer = (unsigned char *) emalloc(buflen);     /* isn't NULL terminated */
-       if (buffer == NULL)
-               return NULL;
        for (bp = buffer, sp = strtext; *sp != '\0'; bp++, sp++)
        {
                switch (state)
@@ -2744,7 +2740,7 @@
 {
        char *from = NULL, *to = NULL;
        size_t to_len;
-       long from_len;
+       int from_len;
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
                                                          &from, &from_len) == 
FAILURE) {
                return;
@@ -2957,7 +2953,7 @@
 /* }}} */
 
 
-/* {{{ proto resource pg_get_result([resource connection])
+/* {{{ proto resource pg_get_result(resource connection)
    Get asynchronous query result */
 PHP_FUNCTION(pg_get_result)
 {
@@ -3081,7 +3077,7 @@
        PGresult *pg_result;
        char *tmp_name;
        smart_str querystr = {0};
-       size_t new_len;
+       int new_len;
        int i, num_rows;
        zval *elem;
        
@@ -3269,11 +3265,7 @@
                return FAILURE;
        }
        subs = (regmatch_t *)ecalloc(sizeof(regmatch_t), re.re_nsub+1);
-       if (!subs) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot allocate memory.");
-               regfree(&re);
-               return FAILURE;
-       }
+
        regerr = regexec(&re, str, re.re_nsub+1, subs, 0);
        if (regerr == REG_NOMATCH) {
 #ifdef PHP_DEBUG               
@@ -3353,11 +3345,7 @@
                return FAILURE;
        }
        MAKE_STD_ZVAL(meta);
-       if (array_init(meta) == FAILURE) {
-               zval_dtor(meta);
-               FREE_ZVAL(meta);
-               return FAILURE;
-       }
+       array_init(meta);
        if (php_pgsql_meta_data(pg_link, table_name, meta TSRMLS_CC) == FAILURE) {
                zval_dtor(meta);
                FREE_ZVAL(meta);
@@ -3981,7 +3969,8 @@
        char buf[256];
        char *fld;
        smart_str querystr = {0};
-       int key_type, fld_len, ret = FAILURE;
+       int key_type, ret = FAILURE;
+       uint fld_len;
        ulong num_idx;
        HashPosition pos;
 
@@ -4111,7 +4100,7 @@
 static inline int build_assignment_string(smart_str *querystr, HashTable *ht, const 
char *pad, int pad_len TSRMLS_DC)
 {
        HashPosition pos;
-       size_t fld_len;
+       uint fld_len;
        int key_type;
        ulong num_idx;
        char *fld;



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

Reply via email to