diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-23 08:17:38 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-23 08:17:38 +0200 |
commit | c0df64db6c13a8880a0d204fedfd7841f813c255 (patch) | |
tree | 0952fd6f0ce0640db00310dca2625d753d29cb88 /src | |
parent | f79e6735864a16c20d0ed0cc9d79c8c20aeb4816 (diff) |
Bookmarks: Crash when removing a tag
Diffstat (limited to 'src')
-rw-r--r-- | src/bookmarks.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bookmarks.c b/src/bookmarks.c index 5815f447..7560a24c 100644 --- a/src/bookmarks.c +++ b/src/bookmarks.c | |||
@@ -65,8 +65,10 @@ void addTag_Bookmark(iBookmark *d, const char *tag) { | |||
65 | 65 | ||
66 | void removeTag_Bookmark(iBookmark *d, const char *tag) { | 66 | void removeTag_Bookmark(iBookmark *d, const char *tag) { |
67 | const size_t pos = indexOfCStr_String(&d->tags, tag); | 67 | const size_t pos = indexOfCStr_String(&d->tags, tag); |
68 | remove_Block(&d->tags.chars, pos, strlen(tag)); | 68 | if (pos != iInvalidPos) { |
69 | trim_String(&d->tags); | 69 | remove_Block(&d->tags.chars, pos, strlen(tag)); |
70 | trim_String(&d->tags); | ||
71 | } | ||
70 | } | 72 | } |
71 | 73 | ||
72 | iDefineTypeConstruction(Bookmark) | 74 | iDefineTypeConstruction(Bookmark) |