Commit 130c1fce authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

zaxisDefVct: allow overwrite of vct

parent 44026768
...@@ -1010,16 +1010,14 @@ void zaxisDefVct(int zaxisID, int size, const double *vct) ...@@ -1010,16 +1010,14 @@ void zaxisDefVct(int zaxisID, int size, const double *vct)
{ {
zaxis_t *zaxisptr = zaxisID2Ptr(zaxisID); zaxis_t *zaxisptr = zaxisID2Ptr(zaxisID);
if ( zaxisptr->vct == 0 ) if ( zaxisptr->vct == 0 || zaxisptr->vctsize != size )
{ {
zaxisptr->vctsize = size; zaxisptr->vctsize = size;
zaxisptr->vct = (double *)xmalloc((size_t)size * sizeof (double)); zaxisptr->vct = (double *) realloc(zaxisptr->vct, (size_t)size*sizeof(double));
memcpy(zaxisptr->vct, vct, (size_t)size * sizeof (double));
reshSetStatus(zaxisID, &zaxisOps, RESH_DESYNC_IN_USE);
} }
else
if ( zaxisptr->vctsize != size ) memcpy(zaxisptr->vct, vct, (size_t)size*sizeof(double));
Warning("VCT was already defined"); reshSetStatus(zaxisID, &zaxisOps, RESH_DESYNC_IN_USE);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment