From 198f0de4fc0487520d3434ee54ab8b9bd3b8fbd4 Mon Sep 17 00:00:00 2001 From: stevenj Date: Thu, 19 Aug 2010 03:36:43 -0400 Subject: [PATCH] =?utf8?q?fixed=20bug=20in=20set/get=20xtol=5Fabs,=20thank?= =?utf8?q?s=20to=20David=20Rivest-H=C3=A9nault=20for=20the=20bug=20report?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit darcs-hash:20100819073643-c8de0-80e9c5691ef76d73f33255b0b615dced6374467a.gz --- api/options.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/options.c b/api/options.c index 9dd9bb4..0c86418 100644 --- a/api/options.c +++ b/api/options.c @@ -507,7 +507,7 @@ nlopt_result NLOPT_STDCALL nlopt_set_xtol_abs(nlopt_opt opt, const double *xtol_abs) { if (opt) { - memcpy(opt->xtol_abs, xtol_abs, opt->n & sizeof(double)); + memcpy(opt->xtol_abs, xtol_abs, opt->n * sizeof(double)); return NLOPT_SUCCESS; } return NLOPT_INVALID_ARGS; @@ -528,7 +528,7 @@ NLOPT_STDCALL nlopt_set_xtol_abs1(nlopt_opt opt, const double xtol_abs) nlopt_result NLOPT_STDCALL nlopt_get_xtol_abs(const nlopt_opt opt, double *xtol_abs) { - memcpy(xtol_abs, opt->xtol_abs, opt->n & sizeof(double)); + memcpy(xtol_abs, opt->xtol_abs, opt->n * sizeof(double)); return NLOPT_SUCCESS; } -- 2.30.2