cvs: php-src /ext/pdo_sqlite sqlite_statement.c
| From: | Alexey Zakhlestin | Date: | Wed, 01 Apr 2009 14:34:21 +0000 |
| Subject: | cvs: php-src /ext/pdo_sqlite sqlite_statement.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-56849@lists.php.net to get a copy of this message | ||
indeyets Wed Apr 1 14:34:21 2009 UTC
Modified files:
/php-src/ext/pdo_sqlite sqlite_statement.c
Log:
reverted previous patch, using explicit cast instead
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_sqlite/sqlite_statement.c?r1=1.30&r2=1.31&diff_format=u
Index: php-src/ext/pdo_sqlite/sqlite_statement.c
diff -u php-src/ext/pdo_sqlite/sqlite_statement.c:1.30
php-src/ext/pdo_sqlite/sqlite_statement.c:1.31
--- php-src/ext/pdo_sqlite/sqlite_statement.c:1.30 Wed Apr 1 11:31:54 2009
+++ php-src/ext/pdo_sqlite/sqlite_statement.c Wed Apr 1 14:34:21 2009
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sqlite_statement.c,v 1.30 2009/04/01 11:31:54 indeyets Exp $ */
+/* $Id: sqlite_statement.c,v 1.31 2009/04/01 14:34:21 indeyets Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -282,9 +282,7 @@
static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, long colno, zval *return_value TSRMLS_DC)
{
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
- const char *_str;
- size_t _str_len;
- char *str;
+ const char *str;
zval *flags;
if (!S->stmt) {
@@ -320,21 +318,15 @@
break;
}
- _str = sqlite3_column_decltype(S->stmt, colno);
- _str_len = strlen(_str);
- if (_str) {
- str = emalloc(_str_len);
- strcpy(str, _str);
- add_assoc_string(return_value, "sqlite:decl_type", str, 1);
+ str = sqlite3_column_decltype(S->stmt, colno);
+ if (str) {
+ add_assoc_string(return_value, "sqlite:decl_type", (char *)str, 1);
}
#ifdef SQLITE_ENABLE_COLUMN_METADATA
- _str = sqlite3_column_table_name(S->stmt, colno);
- _str_len = strlen(_str);
- if (_str) {
- str = emalloc(_str_len);
- strcpy(str, _str);
- add_assoc_string(return_value, "table", str, 1);
+ str = sqlite3_column_table_name(S->stmt, colno);
+ if (str) {
+ add_assoc_string(return_value, "table", (char *)str, 1);
}
#endif