Properly set the initial bookmark name

This commit is contained in:
WerWolv 2021-01-13 22:53:33 +01:00
parent 0a8368d639
commit cd200b978b
1 changed files with 4 additions and 4 deletions

View File

@ -13,10 +13,10 @@ namespace hex {
bookmark.name.resize(64); bookmark.name.resize(64);
bookmark.comment.resize(0xF'FFFF); bookmark.comment.resize(0xF'FFFF);
if (bookmark.name.empty()) {
std::memset(bookmark.name.data(), 0x00, 64); std::memset(bookmark.name.data(), 0x00, 64);
std::strcpy(bookmark.name.data(), ("Bookmark " + std::to_string(this->m_bookmarks.size() + 1)).c_str()); 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()) if (bookmark.comment.empty())
std::memset(bookmark.comment.data(), 0x00, 0xF'FFFF); std::memset(bookmark.comment.data(), 0x00, 0xF'FFFF);