aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Snover2017-12-05 11:15:00 -0600
committerEugene Sandulenko2018-08-18 16:30:05 +0200
commit072a52a9d25dfcc59ba7d18049cc29cd17acaffa (patch)
tree90d8ae0b62841f5b43c11f5fe0b5c7d5e7955953
parentf7e05a6acefc20be045fbc703b358c6c6ba67503 (diff)
downloadscummvm-rg350-072a52a9d25dfcc59ba7d18049cc29cd17acaffa.tar.gz
scummvm-rg350-072a52a9d25dfcc59ba7d18049cc29cd17acaffa.tar.bz2
scummvm-rg350-072a52a9d25dfcc59ba7d18049cc29cd17acaffa.zip
SCUMM: Replace use of strdup with Common::String
-rw-r--r--engines/scumm/smush/smush_font.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/engines/scumm/smush/smush_font.cpp b/engines/scumm/smush/smush_font.cpp
index e2f75a6862..01ac202d37 100644
--- a/engines/scumm/smush/smush_font.cpp
+++ b/engines/scumm/smush/smush_font.cpp
@@ -22,6 +22,7 @@
#include "common/file.h"
+#include "common/str.h"
#include "scumm/scumm.h"
#include "scumm/util.h"
@@ -226,11 +227,11 @@ void SmushFont::drawStringWrap(const char *str, byte *buffer, int dst_width, int
debugC(DEBUG_SMUSH, "SmushFont::drawStringWrap(%s, %d, %d, %d, %d, %d)", str, x, y, left, right, center);
const int width = right - left;
- char *s = strdup(str);
+ Common::String s(str);
char *words[MAX_WORDS];
int word_count = 0;
- char *tmp = s;
+ Common::String::iterator tmp = s.begin();
while (tmp) {
assert(word_count < MAX_WORDS);
words[word_count++] = tmp;
@@ -293,8 +294,6 @@ void SmushFont::drawStringWrap(const char *str, byte *buffer, int dst_width, int
y += getStringHeight(substrings[i]);
}
}
-
- free(s);
}
} // End of namespace Scumm