From 20da9cc7d86bb6be94afc77cb62f94ecf32f2dfb Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 18 Nov 2022 14:08:16 +0100 Subject: [PATCH] Better Error handling in point --- org/qmckl_point.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/org/qmckl_point.org b/org/qmckl_point.org index aa2ba2a..592e7a3 100644 --- a/org/qmckl_point.org +++ b/org/qmckl_point.org @@ -283,6 +283,13 @@ qmckl_set_point (qmckl_context context, return QMCKL_NULL_CONTEXT; } + if (num <= 0) { + return qmckl_failwith( context, + QMCKL_INVALID_ARG_4, + "qmckl_set_point", + "Number of points should be >0."); + } + if (size_max < 3*num) { return qmckl_failwith( context, QMCKL_INVALID_ARG_4,