1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-07-07 18:30:34 +00:00

fix a potential dangerous pointer

This commit is contained in:
Lu Wang 2012-09-11 16:37:41 +08:00
parent 0e27f4b1c5
commit 64a765e90f

View File

@ -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("; 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) 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 else
{ {
allcss_fout << fn; allcss_fout << (char*)fn;
} }
} }