Fix compiler warning in pcre2test

This commit is contained in:
Philip Hazel 2022-06-08 17:05:24 +01:00
parent 45af1203bd
commit 5271b533c4
3 changed files with 7 additions and 4 deletions

View File

@ -18,6 +18,9 @@ size_t values.
4. PR #94 showed up an unused enum in pcre2_convert.c, which is now removed.
5. Minor code re-arrangement to remove gcc warning about realloc() in
pcre2test.
Version 10.40 15-April-2022
---------------------------

View File

@ -9,9 +9,9 @@ dnl The PCRE2_PRERELEASE feature is for identifying release candidates. It might
dnl be defined as -RC2, for example. For real releases, it should be empty.
m4_define(pcre2_major, [10])
m4_define(pcre2_minor, [40])
m4_define(pcre2_minor, [41])
m4_define(pcre2_prerelease, [])
m4_define(pcre2_date, [2022-04-14])
m4_define(pcre2_date, [2022-xx-xx])
# Libtool shared library interface versions (current:revision:age)
m4_define(libpcre2_8_version, [11:0:11])

View File

@ -6763,8 +6763,6 @@ while ((c = *p++) != 0)
{
long li;
char *endptr;
size_t qoffset = CAST8VAR(q) - dbuffer;
size_t rep_offset = start_rep - dbuffer;
if (*p++ != '{')
{
@ -6798,6 +6796,8 @@ while ((c = *p++) != 0)
if (needlen >= dbuffer_size)
{
size_t qoffset = CAST8VAR(q) - dbuffer;
size_t rep_offset = start_rep - dbuffer;
while (needlen >= dbuffer_size) dbuffer_size *= 2;
dbuffer = (uint8_t *)realloc(dbuffer, dbuffer_size);
if (dbuffer == NULL)