From 305da4a88ab1b9a8405c843bf519a19fd039152b Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Mon, 23 Jun 2014 22:58:09 +0800 Subject: We don't need extra 1 byte anymore --- ext/mysqlnd/mysqlnd_wireprotocol.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'ext/mysqlnd/mysqlnd_wireprotocol.c') diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index 8cdd712f0b..9beac3d0b2 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; -- cgit v1.2.1