diff options
| -rw-r--r-- | ext/pgsql/pgsql.c | 43 | ||||
| -rw-r--r-- | ext/standard/url_scanner.c | 4 | ||||
| -rw-r--r-- | ext/standard/url_scanner_ex.c | 6 | ||||
| -rw-r--r-- | ext/standard/url_scanner_ex.re | 2 |
4 files changed, 22 insertions, 33 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 07c148ff62..fd85be62f9 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -997,7 +997,7 @@ static void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_ty #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 @@ PHP_FUNCTION(pg_lo_unlink) 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 @@ PHP_FUNCTION(pg_lo_open) 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 @@ PHP_FUNCTION(pg_lo_export) { 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 @@ PHP_FUNCTION(pg_copy_to) 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_copy_from) 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 @@ PHP_FUNCTION(pg_escape_bytea) { 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 @@ static unsigned char * php_pgsql_unescape_bytea(unsigned char *strtext, size_t * 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 @@ PHP_FUNCTION(pg_unescape_bytea) { 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 @@ PHP_FUNCTION(pg_send_query) /* }}} */ -/* {{{ 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 @@ PHPAPI int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *me 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 @@ static int php_pgsql_convert_match(const char *str, const char *regex , int icas 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 @@ PHPAPI int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval 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 @@ PHPAPI int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var_array, 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 @@ PHP_FUNCTION(pg_insert) 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; diff --git a/ext/standard/url_scanner.c b/ext/standard/url_scanner.c index 20ccc4b2a0..b77931eaa5 100644 --- a/ext/standard/url_scanner.c +++ b/ext/standard/url_scanner.c @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Author: Hartmut Holzgraefe <hartmut@six.de> | + | Author: Hartmut Holzgraefe <hholzgra@php.net> | +----------------------------------------------------------------------+ */ /* $Id$ */ @@ -88,7 +88,7 @@ static char *url_attr_addon(const char *tag,const char *attr,const char *val,con /* {{{ url_adapt_ext */ -char *url_adapt_ext(const char *src, size_t srclen, const char *name, const char *val, size_t *newlen) +char *url_adapt_ext(const char *src, uint srclen, const char *name, const char *val, size_t *newlen) { char buf[1024]; diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index d5d16077f7..32369b525b 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -1,5 +1,5 @@ -/* Generated by re2c 0.5 on Wed Feb 12 10:07:57 2003 */ -#line 1 "/home/rei/PHP_CVS/STABLE/php4/ext/standard/url_scanner_ex.re" +/* Generated by re2c 0.5 on Tue Mar 11 01:09:00 2003 */ +#line 1 "/usr/src/web/php/php4/ext/standard/url_scanner_ex.re" /* +----------------------------------------------------------------------+ | PHP Version 4 | @@ -860,7 +860,7 @@ char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const cha } -static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush TSRMLS_DC) +static char *url_adapt_ext(const char *src, uint srclen, uint *newlen, zend_bool do_flush TSRMLS_DC) { url_adapt_state_ex_t *ctx; char *retval; diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re index f3c638863e..88254bc75c 100644 --- a/ext/standard/url_scanner_ex.re +++ b/ext/standard/url_scanner_ex.re @@ -359,7 +359,7 @@ char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const cha } -static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush TSRMLS_DC) +static char *url_adapt_ext(const char *src, uint srclen, uint *newlen, zend_bool do_flush TSRMLS_DC) { url_adapt_state_ex_t *ctx; char *retval; |
