aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2024-02-17 21:42:10 +0100
committerJay Berkenbilt <ejb@ql.org>2024-02-17 22:13:42 +0100
commit7bc52c5728591674f864ce7ff10c4bbe24787333 (patch)
tree7e12b911eeabc3542af984a04772c56f392a57b6 /libqpdf
parent072623d6e80129fe6a716a60bb85200f7300acd5 (diff)
downloadqpdf-7bc52c5728591674f864ce7ff10c4bbe24787333.tar.zst
set page labels: detect start page < 1 (fixes #939)
Diffstat (limited to 'libqpdf')
-rw-r--r--libqpdf/QPDFJob_config.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/libqpdf/QPDFJob_config.cc b/libqpdf/QPDFJob_config.cc
index e9084e85..107abf7c 100644
--- a/libqpdf/QPDFJob_config.cc
+++ b/libqpdf/QPDFJob_config.cc
@@ -1139,6 +1139,9 @@ QPDFJob::Config::setPageLabels(const std::vector<std::string>& specs)
}
auto start_num = match[3].matched ? QUtil::string_to_int(match[3].str().c_str()) : 1;
+ if (start_num < 1) {
+ usage("starting page number must be >= 1");
+ }
auto prefix = match[4].matched ? match[4].str() : "";
// We can't check ordering until we know how many pages there are, so that is delayed until
// near the end.