summaryrefslogtreecommitdiffstats
path: root/src/2geom/sbasis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/2geom/sbasis.cpp')
-rw-r--r--src/2geom/sbasis.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/2geom/sbasis.cpp b/src/2geom/sbasis.cpp
index 4f1df621e..42d92d7b8 100644
--- a/src/2geom/sbasis.cpp
+++ b/src/2geom/sbasis.cpp
@@ -328,9 +328,9 @@ SBasis derivative(SBasis const &a) {
}
int k = a.size()-1;
double d = (2*k+1)*(a[k][1] - a[k][0]);
- if(d == 0)
+ if (d == 0 && k > 0) {
c.pop_back();
- else {
+ } else {
c[k][0] = d;
c[k][1] = d;
}
@@ -351,9 +351,9 @@ void SBasis::derive() { // in place version
}
int k = size()-1;
double d = (2*k+1)*((*this)[k][1] - (*this)[k][0]);
- if(d == 0)
+ if (d == 0 && k > 0) {
pop_back();
- else {
+ } else {
(*this)[k][0] = d;
(*this)[k][1] = d;
}