]> granicus.if.org Git - php/commitdiff
Only write single terminating byte
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 20 Jul 2017 19:14:01 +0000 (21:14 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 20 Jul 2017 19:41:52 +0000 (21:41 +0200)
As far as I could determine this is sufficient. It avoids
reallocating the buffer, if it was perfectly allocated beforehand.

ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c

index 5a2861301429334354575fb58bdf32cd6516ac40..176a7522889f82447f852c980272c73029c24ac8 100644 (file)
@@ -119,7 +119,7 @@ mbfl_memory_device_result(mbfl_memory_device *device, mbfl_string *result)
 {
        if (device && result) {
                result->len = device->pos;
-               mbfl_memory_device_output4('\0', device);
+               mbfl_memory_device_output('\0', device);
                result->val = device->buffer;
                device->buffer = (unsigned char *)0;
                device->length = 0;