summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2009-07-13 18:06:58 +0300
committerVille Skyttä <ville.skytta@iki.fi>2009-07-13 18:06:58 +0300
commitc0542dc4cef38987a1e377ac5d31a8987c9955d3 (patch)
tree0b8196c35fb666fa786da4b1589c04c2857c0e4f
parent294e778e92f66570eea390686ba1189bb6821adb (diff)
downloadvdr-plugin-text2skin-c0542dc4cef38987a1e377ac5d31a8987c9955d3.tar.gz
vdr-plugin-text2skin-c0542dc4cef38987a1e377ac5d31a8987c9955d3.tar.bz2
Replace asprintf by cString::sprintf in font loading.
-rw-r--r--HISTORY2
-rw-r--r--font.c4
2 files changed, 2 insertions, 4 deletions
diff --git a/HISTORY b/HISTORY
index 03d1b17..56cb96a 100644
--- a/HISTORY
+++ b/HISTORY
@@ -75,7 +75,7 @@ ____-__-__: Version 1.3
- Use pkg-config to find compilation flags, libs etc for Imlib2.
- Fixed crash with FrontendHasLock and FrontendHasSignal (closes #147 -
thanks to a.g.prosat at tochka.ru for reporting this)
-- Replaced asprintf with cString::sprintf in GetFrontend*()
+- Replaced asprintf with cString::sprintf in GetFrontend*(), font loading.
- Removed useless code in loader.c
- Replace internal freetype font handling with VDR's font facilities. Skins
that use fonts other than VDR's standard "Osd", "Fix", and "Sml" need to be
diff --git a/font.c b/font.c
index f1cff09..e52c9db 100644
--- a/font.c
+++ b/font.c
@@ -67,12 +67,10 @@ const cFont *cText2SkinFont::Load(const string &Name, int Size)
return cFont::GetFont(fontSml);
const cFont *res = NULL;
- char *cachename;
- asprintf(&cachename, "%s_%d", Name.c_str(), Size);
+ string cachename = string(cString::sprintf("%s_%d", Name.c_str(), Size));
if (mFontCache.Load(Name, cachename, Size))
res = mFontCache.GetFont(cachename);
else
esyslog("ERROR: Text2Skin: Couldn't load font %s@%d", Name.c_str(), Size);
- free(cachename);
return res;
}