From 24ec94e5b4ed045be0baa0209b7ba908c54ef5371f05bfaa32424a302f568476 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Thu, 21 Aug 2025 15:46:10 -0400 Subject: [PATCH] More local ownership --- src/html.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/html.cc b/src/html.cc index 870bd03..74b40ad 100644 --- a/src/html.cc +++ b/src/html.cc @@ -1078,7 +1078,6 @@ static void Html_process_space_pre_line(DilloHtml *html, const char *space, static void Html_process_space(DilloHtml *html, const char *space, int spacesize) { - char *spc; int i, offset; DilloHtmlParseMode parse_mode = S_TOP(html)->parse_mode; @@ -1100,9 +1099,8 @@ static void Html_process_space(DilloHtml *html, const char *space, (space[i] == '\r' || (space[i] == '\n' && !html->PrevWasCR))) { if (spaceCnt) { - spc = dStrnfill(spaceCnt, ' '); - HT2TB(html)->addText (spc, spaceCnt, html->wordStyle ()); - dFree(spc); + std::string spc( spaceCnt, ' ' ); + HT2TB(html)->addText (spc.data(), spaceCnt, html->wordStyle ()); spaceCnt = 0; } HT2TB(html)->addLinebreak (html->wordStyle ()); @@ -1134,9 +1132,8 @@ static void Html_process_space(DilloHtml *html, const char *space, if (spaceCnt) { // add break possibility for the white-space:pre-wrap case HT2TB(html)->addBreakOption (html->wordStyle (), false); - spc = dStrnfill(spaceCnt, ' '); - HT2TB(html)->addText (spc, spaceCnt, html->wordStyle ()); - dFree(spc); + std::string spc( spaceCnt, ' ' ); + HT2TB(html)->addText (spc.data(), spaceCnt, html->wordStyle ()); } } else {