summaryrefslogtreecommitdiffhomepage
path: root/diff.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2023-01-28 17:06:57 +0100
committerRoland Reichwein <mail@reichwein.it>2023-01-28 17:06:57 +0100
commit4247b81e7756ce1ff01e097e634a9dcbc0912787 (patch)
treeaf14dd7aedf6b06826b5c15e3994431ed86f84a7 /diff.cpp
parenta61c702d91d7444ce0bb094ddccc70f72416500b (diff)
Added tests
Diffstat (limited to 'diff.cpp')
-rw-r--r--diff.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/diff.cpp b/diff.cpp
index ee17fad..99a2f14 100644
--- a/diff.cpp
+++ b/diff.cpp
@@ -115,6 +115,10 @@ void Diff::create(const std::string& xml)
m_pos0 = tree.get<int>("diff.start");
m_pos1 = tree.get<int>("diff.end");
+
+ if (m_pos0 > m_pos1)
+ throw std::runtime_error("Bad range in diff");
+
m_data = tree.get<std::string>("diff.data");
}