summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug/debugcmd.cpp
diff options
context:
space:
mode:
author dankan1890 <mewuidev2@gmail.com>2016-01-29 00:43:18 +0100
committer dankan1890 <mewuidev2@gmail.com>2016-01-29 00:43:18 +0100
commit361d32d37ffbe133760fcbfa314f60ccd4a8e8a8 (patch)
tree31813d7d743784862112bd647ee6da3b1361158b /src/emu/debug/debugcmd.cpp
parentcb1d7fe7fc942677c6aae668e283073f08a11199 (diff)
Small code cleanup:
- corealloc.h: added macro definition for global_alloc (nothrow) memory allocation. - textbuf.cpp / wavwrite.cpp: removed pointless cast. - debugcmd.cpp / luaengine.cpp / render.cpp: avoid strlen calls in a loop. - diimage.cpp: simplified "device_image_interface::set_image_filename" function. - miscmenu.cpp / selgame.h / video.cpp(h): replaced int with bool where applicable. - ui.cpp: removed unused code.
Diffstat (limited to 'src/emu/debug/debugcmd.cpp')
-rw-r--r--src/emu/debug/debugcmd.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp
index 4558413b2c3..7ad039806ea 100644
--- a/src/emu/debug/debugcmd.cpp
+++ b/src/emu/debug/debugcmd.cpp
@@ -2381,11 +2381,12 @@ static void execute_find(running_machine &machine, int ref, int params, const ch
for (int i = 2; i < params; i++)
{
const char *pdata = param[i];
+ size_t pdatalen = strlen(pdata) - 1;
/* check for a string */
- if (pdata[0] == '"' && pdata[strlen(pdata) - 1] == '"')
+ if (pdata[0] == '"' && pdata[pdatalen] == '"')
{
- for (j = 1; j < strlen(pdata) - 1; j++)
+ for (j = 1; j < pdatalen; j++)
{
data_to_find[data_count] = pdata[j];
data_size[data_count++] = 1;