aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/print.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-08 08:26:03 +0100
committereldritch horrors <pennae@lix.systems>2024-03-09 07:20:23 -0700
commit4dabde04853d8eb3924750f0c1c1841b6119d81d (patch)
tree06e4da6f6387cba27b2f58abdf689ca7d9c1ac46 /src/libexpr/print.cc
parent1958152d146389b00c50a149c33012a16864ef83 (diff)
Add assertion for decreasing the indent
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com> (cherry picked from commit a27651908fc1b5ef73a81e46434a408c5868fa7b) Change-Id: I2ec78e234c1c6e982f7b05f81d8b8356daf6c274
Diffstat (limited to 'src/libexpr/print.cc')
-rw-r--r--src/libexpr/print.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libexpr/print.cc b/src/libexpr/print.cc
index 53d0861bf..76f9a9c56 100644
--- a/src/libexpr/print.cc
+++ b/src/libexpr/print.cc
@@ -174,6 +174,7 @@ private:
void decreaseIndent()
{
if (options.prettyPrint()) {
+ assert(indent.size() >= options.prettyIndent);
indent.resize(indent.size() - options.prettyIndent);
}
}