From: stevenj Date: Thu, 19 Aug 2010 07:36:43 +0000 (-0400) Subject: fixed bug in set/get xtol_abs, thanks to David Rivest-Hénault for the bug report X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=198f0de4fc0487520d3434ee54ab8b9bd3b8fbd4;p=nlopt.git fixed bug in set/get xtol_abs, thanks to David Rivest-Hénault for the bug report darcs-hash:20100819073643-c8de0-80e9c5691ef76d73f33255b0b615dced6374467a.gz --- 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; }