diff options
author | Cameron Cawley | 2018-08-18 13:34:28 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-18 16:30:05 +0200 |
commit | 7a437e909ce81894d4ad9f1e22b55e609becb9bb (patch) | |
tree | 469fa427f5a571e32c249e803dcacde795124a24 /graphics/fonts | |
parent | d43732ac47bacab53578c6217cb4dbd42da6b9c6 (diff) | |
download | scummvm-rg350-7a437e909ce81894d4ad9f1e22b55e609becb9bb.tar.gz scummvm-rg350-7a437e909ce81894d4ad9f1e22b55e609becb9bb.tar.bz2 scummvm-rg350-7a437e909ce81894d4ad9f1e22b55e609becb9bb.zip |
COMMON: Move new_strdup to common/str.cpp
Diffstat (limited to 'graphics/fonts')
-rw-r--r-- | graphics/fonts/bdf.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/graphics/fonts/bdf.cpp b/graphics/fonts/bdf.cpp index 96255dc4d4..8424e00303 100644 --- a/graphics/fonts/bdf.cpp +++ b/graphics/fonts/bdf.cpp @@ -700,15 +700,6 @@ BdfFont *BdfFont::loadFromCache(Common::SeekableReadStream &stream) { return new BdfFont(data, DisposeAfterUse::YES); } -static char *new_strdup(const char *in) { - const size_t len = strlen(in) + 1; - char *out = new char[len]; - if (out) { - strcpy(out, in); - } - return out; -} - BdfFont *BdfFont::scaleFont(BdfFont *src, int newSize) { if (!src) { warning("Empty font reference in scale font"); @@ -734,8 +725,8 @@ BdfFont *BdfFont::scaleFont(BdfFont *src, int newSize) { data.firstCharacter = src->_data.firstCharacter; data.defaultCharacter = src->_data.defaultCharacter; data.numCharacters = src->_data.numCharacters; - data.familyName = new_strdup(src->_data.familyName); - data.slant = new_strdup(src->_data.slant); + data.familyName = scumm_strdup(src->_data.familyName); + data.slant = scumm_strdup(src->_data.slant); BdfBoundingBox *boxes = new BdfBoundingBox[data.numCharacters]; for (int i = 0; i < data.numCharacters; ++i) { |