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 {