com php-src: We don't need extra 1 byte anymore: ext/mysqlnd/my sqlnd_wireprotocol.c
| From: | Xinchen Hui | Date: | Mon, 23 Jun 2014 14:58:09 +0000 |
| Subject: | com php-src: We don't need extra 1 byte anymore: ext/mysqlnd/my sqlnd_wireprotocol.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-79027@lists.php.net to get a copy of this message | ||
Commit: 305da4a88ab1b9a8405c843bf519a19fd039152b
Author: Xinchen Hui <laruence@php.net> Mon, 23 Jun 2014 22:58:09 +0800
Parents: ba45650d632f2116178ec282deda98bc65d9b09c
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=305da4a88ab1b9a8405c843bf519a19fd039152b
Log:
We don't need extra 1 byte anymore
Changed paths:
M ext/mysqlnd/mysqlnd_wireprotocol.c
Diff:
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index 8cdd712..9beac3d 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -1397,11 +1397,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL *
result_s
if (first_iteration) {
first_iteration = FALSE;
- /*
- We need a trailing \0 for the last string, in case of text-mode,
- to be able to implement read-only variables. Thus, we add + 1.
- */
- *buffer = result_set_memory_pool->get_chunk(result_set_memory_pool, *data_size + 1
TSRMLS_CC);
+ *buffer = result_set_memory_pool->get_chunk(result_set_memory_pool, *data_size TSRMLS_CC);
if (!*buffer) {
ret = FAIL;
break;
@@ -1415,11 +1411,8 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL *
result_s
/*
We have to realloc the buffer.
-
- We need a trailing \0 for the last string, in case of text-mode,
- to be able to implement read-only variables.
*/
- if (FAIL == (*buffer)->resize_chunk((*buffer), *data_size + 1 TSRMLS_CC)) {
+ if (FAIL == (*buffer)->resize_chunk((*buffer), *data_size TSRMLS_CC)) {
SET_OOM_ERROR(*conn->error_info);
ret = FAIL;
break;