diff options
| author | Andi Gutmans <andi@php.net> | 2004-07-19 07:19:50 +0000 |
|---|---|---|
| committer | Andi Gutmans <andi@php.net> | 2004-07-19 07:19:50 +0000 |
| commit | 56f8195fe592e79d90c78fb015f39bffa7f39422 (patch) | |
| tree | 6a1bf69bc9cd23fab98c4d3d6c12368b56d26079 /ext/oci8/oci8.c | |
| parent | 599ae4b1b53d46e10447dab8fb4faa2d0517370a (diff) | |
| download | php-git-56f8195fe592e79d90c78fb015f39bffa7f39422.tar.gz | |
- Nuke empty_string. It is a reminanent from the time where RETURN_FALSE()
used to return "" and not bool(false). It's not worth keeping it because
STR_FREE() and zval_dtor() always have to check for it and it slows down
the general case. In addition, it seems that empty_string has been abused
quite a lot, and was used not only for setting zval's but generally in
PHP code instead of "", which wasn't the intention. Last but not least,
nuking empty_string should improve stability as I doubt every place
correctly checked if they are not mistakenly erealloc()'ing it or
calling efree() on it.
NOTE: Some code is probably broken. Each extension maintainer should
check and see that my changes are OK. Also, I haven't had time to touch
PECL yet. Will try and do it tomorrow.
Diffstat (limited to 'ext/oci8/oci8.c')
| -rw-r--r-- | ext/oci8/oci8.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 597b177a49..3f46fb4e33 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -880,12 +880,12 @@ static int _oci_bind_post_exec(void *data TSRMLS_DC) if (bind->indicator == -1) { /* NULL */ zval *val = bind->zval; - if (Z_TYPE_P(val) == IS_STRING && (Z_STRVAL_P(val) != empty_string)) { + if (Z_TYPE_P(val) == IS_STRING)) { *Z_STRVAL_P(val) = '\0'; /* XXX avoid warning in debug mode */ } zval_dtor(val); ZVAL_NULL(val); - } else if (Z_TYPE_P(bind->zval) == IS_STRING && (Z_STRVAL_P(bind->zval) != empty_string)) { + } else if (Z_TYPE_P(bind->zval) == IS_STRING) { Z_STRVAL_P(bind->zval) = erealloc(Z_STRVAL_P(bind->zval), Z_STRLEN_P(bind->zval)+1); Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] = '\0'; } |
