From cd200b978bd2ae6a70d391cde101ff5d50676f91 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 13 Jan 2021 22:53:33 +0100 Subject: [PATCH] Properly set the initial bookmark name --- source/views/view_bookmarks.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/views/view_bookmarks.cpp b/source/views/view_bookmarks.cpp index 13c0cd10f..c2ecae5ad 100644 --- a/source/views/view_bookmarks.cpp +++ b/source/views/view_bookmarks.cpp @@ -13,10 +13,10 @@ namespace hex { bookmark.name.resize(64); bookmark.comment.resize(0xF'FFFF); - if (bookmark.name.empty()) { - std::memset(bookmark.name.data(), 0x00, 64); - std::strcpy(bookmark.name.data(), ("Bookmark " + std::to_string(this->m_bookmarks.size() + 1)).c_str()); - } + std::memset(bookmark.name.data(), 0x00, 64); + std::strcpy(bookmark.name.data(), hex::format("Bookmark [0x%lX - 0x%lX]", + bookmark.region.address, + bookmark.region.address + bookmark.region.size - 1).c_str()); if (bookmark.comment.empty()) std::memset(bookmark.comment.data(), 0x00, 0xF'FFFF);