aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYour Name <you@example.com>2022-02-24 13:05:40 -0500
committerYour Name <you@example.com>2022-02-24 13:05:40 -0500
commitff7307324ce69f3d55aa935db5aa0f1802785115 (patch)
treed2a096880c685e439f6223a9ed16292cb1596896
parent4f26d55e01f9424ba5660cb27076eafba4c88b21 (diff)
downloadbiblereader-ff7307324ce69f3d55aa935db5aa0f1802785115.tar.gz
biblereader-ff7307324ce69f3d55aa935db5aa0f1802785115.tar.bz2
biblereader-ff7307324ce69f3d55aa935db5aa0f1802785115.zip
Fixed issue when compiling with -D_GLIBCXX_ASSERTIONSv1.0.6
-rw-r--r--src/sword.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sword.cc b/src/sword.cc
index a693085..936100a 100644
--- a/src/sword.cc
+++ b/src/sword.cc
@@ -97,7 +97,7 @@ void Sword::fillBuffer(string ref, Glib::RefPtr<Gtk::TextBuffer> buf) {
} else if (modifier == "title") {
tags.push_back(titleScale);
// Ensure newline
- if(tex.text.back() != '\n') {
+ if(!tex.text.empty() and tex.text.back() != '\n') {
tex.text.push_back('\n');
}
} else if (modifier == "preverse") {
@@ -135,7 +135,7 @@ void Sword::fillBuffer(string ref, Glib::RefPtr<Gtk::TextBuffer> buf) {
} else {
iter = buf->insert_with_tags(iter, tex.text, tags);
}
- if(tex.text.back() == '\n') {
+ if(!tex.text.empty() and tex.text.back() == '\n') {
isNewline = true;
} else {
isNewline = false;