From f36e484cfb8a919e8bc587bec91d14ef55e2eb1b Mon Sep 17 00:00:00 2001 From: dweatherford Date: Fri, 2 Nov 2007 02:22:25 +0000 Subject: [PATCH] [thrift] return empty string instead of NULL Summary: Turns out they're different, oops Reviewed By: marcel Test Plan: recompile, reinstall, synapse:tablet.get() on a nonexistent cell (which returns an empty string) Revert: ok git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665318 13f79535-47bb-0310-9956-ffa450edef68 --- lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp b/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp index 38af4ab9..1df54d54 100644 --- a/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp +++ b/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp @@ -232,10 +232,10 @@ void binary_deserialize(long thrift_typeID, PHPTransport& transport, zval* retur uint32_t size; transport.readBytes(&size, 4); size = ntohl(size); - if (! size) { RETURN_NULL(); } char* strbuf = (char*) emalloc(size + 1); - if (! strbuf) { RETURN_NULL(); } - transport.readBytes(strbuf, size); + if (size) { + transport.readBytes(strbuf, size); + } strbuf[size] = '\0'; ZVAL_STRINGL(return_value, strbuf, size, 0); return; -- 2.17.1