diff options
author | Anatol Belski <ab@php.net> | 2016-12-17 20:46:09 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2016-12-17 20:46:09 +0100 |
commit | f86e077ec82a998d66007fd2f1ad2b816245e002 (patch) | |
tree | 14668c3cc0fc0396ba1d10b47a28fd620c02d84e | |
parent | a9e0705b6442580a7f4712b8609593362896d27f (diff) | |
parent | 58a945cf6881c3971619a56be3057c1ed86636ba (diff) | |
download | php-git-f86e077ec82a998d66007fd2f1ad2b816245e002.tar.gz |
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
fix C89 compat
-rw-r--r-- | ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c b/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c index c4d4e7fe37..eae05953b2 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; } |