From 64a765e90f8c280a0b2b0886efff4459e5a1e48f Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Tue, 11 Sep 2012 16:37:41 +0800 Subject: [PATCH] fix a potential dangerous pointer --- src/HTMLRenderer/export.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/HTMLRenderer/export.cc b/src/HTMLRenderer/export.cc index 00fbcab..ed7af33 100644 --- a/src/HTMLRenderer/export.cc +++ b/src/HTMLRenderer/export.cc @@ -18,14 +18,14 @@ void HTMLRenderer::export_remote_font(const FontInfo & info, const string & suff allcss_fout << "@font-face{font-family:f" << info.id << ";src:url("; { - const char * fn = str_fmt("f%llx%s", info.id, suffix.c_str()); + auto fn = str_fmt("f%llx%s", info.id, suffix.c_str()); if(param->single_html) { - allcss_fout << "'data:font/" << fontfileformat << ";base64," << base64stream(ifstream(tmp_dir + "/" + fn, ifstream::binary)) << "'"; + allcss_fout << "'data:font/" << fontfileformat << ";base64," << base64stream(ifstream(tmp_dir + "/" + (char*)fn, ifstream::binary)) << "'"; } else { - allcss_fout << fn; + allcss_fout << (char*)fn; } }