From a70770ecef11ce40eefb87a074a4e1cf7e81d51c Mon Sep 17 00:00:00 2001 From: Andreas Untergasser Date: Wed, 25 Sep 2024 20:37:00 +0200 Subject: [PATCH] Fix not allowing negative positions after first index correction --- src/libprimer3.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libprimer3.cc b/src/libprimer3.cc index 54a13f9..7da003d 100644 --- a/src/libprimer3.cc +++ b/src/libprimer3.cc @@ -7783,9 +7783,12 @@ _check_and_adjust_1_interval(const char *tag_name, pr_append(err, " illegal interval"); return 1; } - intervals[i][0] -= first_index; + if (intervals[i][0] - first_index > 0) { + intervals[i][0] -= first_index; + } else { + intervals[i][0] = 0; + } } - for (i=0; i < num_intervals; i++) { if (empty_allowed && (intervals[i][0] == -1) && (intervals[i][1] == -1)) continue;