From 70290b3e2db9041df3f6e23f4506534ddf24081e Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 12 Jul 2023 10:27:06 +0100 Subject: [PATCH] wmkdep: Corrected string reallocation for a very uncommon special case Resolves bug-report https://bugs.openfoam.org/view.php?id=3995 --- wmake/src/wmkdep.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wmake/src/wmkdep.l b/wmake/src/wmkdep.l index 4a1ff8abb4..5b71821430 100644 --- a/wmake/src/wmkdep.l +++ b/wmake/src/wmkdep.l @@ -3,7 +3,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -430,7 +430,7 @@ char* strRep(char* str, struct searchReplace* sr) { if (sr->replaceLen > sr->searchLen) { - const size_t start = str - searchStart; + const size_t start = searchStart - str; str = realloc ( str,