From dec64ad9f845e4361897690d56965e8163a4c0a17fb2d40c9f2a2f4c5603f466 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Tue, 5 Aug 2025 02:20:34 -0400 Subject: [PATCH] Another local string. --- dw/hyphenator.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dw/hyphenator.cc b/dw/hyphenator.cc index 74a947b..ccfc14f 100644 --- a/dw/hyphenator.cc +++ b/dw/hyphenator.cc @@ -181,7 +181,8 @@ void Hyphenator::insertException (char *s) if((unsigned char)s[i] == 0xc2 && (unsigned char)s[i + 1] == 0xad) breaks->put (new Integer (i - 2 * breaks->size())); - char *noHyphens = new char[len - 2 * breaks->size() + 1]; + std::string noHyphens; + noHyphens.resize( len - 2 * breaks->size() + 1 ); int j = 0; for (int i = 0; i < len; ) { if(i < len - 1 && @@ -192,8 +193,7 @@ void Hyphenator::insertException (char *s) } noHyphens[j] = 0; - exceptions->put (new String (noHyphens), breaks); - delete[] noHyphens; + exceptions->put (new String (noHyphens.c_str()), breaks); } /**