com php-src: fix C89 compat: ext/mbstring/libmbfl/mbfl/mbfl_m emory_device.c

From: Date: Sat, 17 Dec 2016 19:43:32 +0000
Subject: com php-src: fix C89 compat: ext/mbstring/libmbfl/mbfl/mbfl_m emory_device.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-96363@lists.php.net to get a copy of this message
Commit: 79e47aae4100accd3141357ca2e7d8dc9981da6f Author: Anatol Belski <ab@php.net> Sat, 17 Dec 2016 20:43:32 +0100 Parents: 0c9324ea9ba32e85ccca4f52287d013b0a6ef2a4 Branches: PHP-5.6 PHP-7.0 PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=79e47aae4100accd3141357ca2e7d8dc9981da6f Log: fix C89 compat Changed paths: M ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c Diff: diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c b/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c index c4d4e7f..eae0595 100644 --- a/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c +++ b/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c @@ -239,11 +239,12 @@ mbfl_memory_device_strcat(mbfl_memory_device *device, const char *psrc) if ((device->pos + len) >= device->length) { /* reallocate buffer */ int newlen = device->length + (len + MBFL_MEMORY_DEVICE_ALLOC_SIZE)*sizeof(unsigned char); + unsigned char *tmp; if (newlen <= 0) { /* overflow */ return -1; } - unsigned char *tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char)); + tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char)); if (tmp == NULL) { return -1; } @@ -270,11 +271,12 @@ mbfl_memory_device_strncat(mbfl_memory_device *device, const char *psrc, int len if ((device->pos + len) >= device->length) { /* reallocate buffer */ int newlen = device->length + len + MBFL_MEMORY_DEVICE_ALLOC_SIZE; + unsigned char *tmp; if (newlen <= 0) { /* overflow */ return -1; } - unsigned char *tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char)); + tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char)); if (tmp == NULL) { return -1; } @@ -301,11 +303,12 @@ mbfl_memory_device_devcat(mbfl_memory_device *dest, mbfl_memory_device *src) if ((dest->pos + src->pos) >= dest->length) { /* reallocate buffer */ int newlen = dest->length + src->pos + MBFL_MEMORY_DEVICE_ALLOC_SIZE; + unsigned char *tmp; if (newlen <= 0) { /* overflow */ return -1; } - unsigned char *tmp = (unsigned char *)mbfl_realloc((void *)dest->buffer, newlen*sizeof(unsigned char)); + tmp = (unsigned char *)mbfl_realloc((void *)dest->buffer, newlen*sizeof(unsigned char)); if (tmp == NULL) { return -1; }

« previous php.cvs (#96363) next »