From 973c6cb9bb015dcbae2182734cd387ef8523daa1 Mon Sep 17 00:00:00 2001 From: ansstuff Date: Thu, 27 Sep 2012 17:07:43 +0000 Subject: [PATCH] Debugger: fixed Bookmarks naming --- src/drivers/win/debuggersp.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/drivers/win/debuggersp.cpp b/src/drivers/win/debuggersp.cpp index 00c8bcc0..82b3c29a 100644 --- a/src/drivers/win/debuggersp.cpp +++ b/src/drivers/win/debuggersp.cpp @@ -742,14 +742,20 @@ void NameDebuggerBookmark(HWND hwnd) return; } else { - strcpy(bookmarkDescription, bookmarks_name[selectedItem].c_str()); - // try to find the same address in bookmarks - for (int i = bookmarks_addr.size() - 1; i>= 0; i--) + if (bookmarks_name[selectedItem].size()) { - if (i != selectedItem && bookmarks_addr[i] == bookmarks_addr[selectedItem]) + strcpy(bookmarkDescription, bookmarks_name[selectedItem].c_str()); + } else + { + bookmarkDescription[0] = 0; + // try to find the same address in bookmarks + for (int i = bookmarks_addr.size() - 1; i>= 0; i--) { - strcpy(bookmarkDescription, bookmarks_name[i].c_str()); - break; + if (i != selectedItem && bookmarks_addr[i] == bookmarks_addr[selectedItem] && bookmarks_name[i].size()) + { + strcpy(bookmarkDescription, bookmarks_name[i].c_str()); + break; + } } } // Show the bookmark name dialog