aboutsummaryrefslogtreecommitdiff
path: root/engines/lure
diff options
context:
space:
mode:
authorColin Snover2017-12-06 16:31:02 -0600
committerEugene Sandulenko2018-08-18 16:30:05 +0200
commitbc3c8bd8d251b7a0631e1993e6365719382eacf6 (patch)
tree341d12376f13e65eb06f088e1fb09a8c67ec813c /engines/lure
parent0851a30769c6307796d6866da073632c83d61185 (diff)
downloadscummvm-rg350-bc3c8bd8d251b7a0631e1993e6365719382eacf6.tar.gz
scummvm-rg350-bc3c8bd8d251b7a0631e1993e6365719382eacf6.tar.bz2
scummvm-rg350-bc3c8bd8d251b7a0631e1993e6365719382eacf6.zip
LURE: Replace use of strdup with Common::String
Diffstat (limited to 'engines/lure')
-rw-r--r--engines/lure/room.cpp7
-rw-r--r--engines/lure/surface.cpp5
2 files changed, 5 insertions, 7 deletions
diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp
index 1be95ba3d4..cb817abbca 100644
--- a/engines/lure/room.cpp
+++ b/engines/lure/room.cpp
@@ -491,18 +491,17 @@ void Room::update() {
if (_hotspotId != 0)
s.writeString(0, 0, _hotspotName, false);
} else {
- // Word wrap (if necessary) the status line and dispaly it
- char *statusLineCopy = strdup(_statusLine);
+ // Word wrap (if necessary) the status line and display it
+ Common::String statusLineCopy(_statusLine);
char **lines;
uint8 numLines;
int16 yPos = 0;
- s.wordWrap(statusLineCopy, s.width(), lines, numLines);
+ s.wordWrap(statusLineCopy.begin(), s.width(), lines, numLines);
for (int lineNum = 0; lineNum < numLines; ++lineNum) {
s.writeString(0, yPos, lines[lineNum], false, white);
yPos += FONT_HEIGHT;
}
Memory::dealloc(lines);
- Memory::dealloc(statusLineCopy);
}
// Debug - if the bottle object is on layer 0FEh, then display it's surface
diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp
index e9de795670..55ba28de9a 100644
--- a/engines/lure/surface.cpp
+++ b/engines/lure/surface.cpp
@@ -479,16 +479,15 @@ Surface *Surface::newDialog(uint16 width, uint8 numLines, const char **lines, bo
Surface *Surface::newDialog(uint16 width, const char *line, int color) {
char **lines;
- char *lineCopy = strdup(line);
+ Common::String lineCopy(line);
uint8 numLines;
- wordWrap(lineCopy, width - (Surface::textX() * 2), lines, numLines);
+ wordWrap(lineCopy.begin(), width - (Surface::textX() * 2), lines, numLines);
// Create the dialog
Surface *result = newDialog(width, numLines, const_cast<const char **>(lines), true, color);
// Deallocate used resources
free(lines);
- free(lineCopy);
return result;
}