bug fix
[satlib.git] / inc_solver.cc
index 28444bcf6ff702368b24d38a7e6444fd05e4c1e5..24c6e88fcb13030d99cf293998fcd2395dadc210 100644 (file)
@@ -48,9 +48,10 @@ int IncrementalSolver::solve() {
     if (numVars > solutionsize) {
       if (solution != NULL)
         free(solution);
-      solution = (int *) malloc(numVars*sizeof(int));
+      solution = (int *) malloc((numVars+1)*sizeof(int));
+      solution[0] = 0;
     }
-    readSolver(solution, numVars * sizeof(int));
+    readSolver(&solution[1], numVars * sizeof(int));
   }
   return result;
 }