Commit 2fab577a authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

zaxisCreate: check number of levels

parent 3a70c8db
......@@ -3,6 +3,10 @@
* Version 1.6.4 released
* using CGRIBEX library version 1.6.4
2014-03-04 Uwe Schulzweida
* zaxisCreate: check number of levels
2014-02-27 Uwe Schulzweida
* added taxisDefFdate() and taxisDefFtime() - Define the forecast reference date
......
......@@ -384,12 +384,11 @@ int gridCreate(int gridtype, int size)
int gridID;
grid_t *gridptr;
if ( CDI_Debug )
Message("gridtype: %d size: %d", gridtype, size);
if ( CDI_Debug ) Message("gridtype=%s size=%d", gridNamePtr(gridtype), size);
if ( size < 0 || size > INT_MAX ) Error("grid size (%d) out of bounds (0 - %d)!", size, INT_MAX);
if ( size < 0 || size > INT_MAX ) Error("Grid size (%d) out of bounds (0 - %d)!", size, INT_MAX);
gridInit ();
gridInit();
gridptr = gridNewEntry();
if ( ! gridptr ) Error("No memory");
......
......@@ -223,10 +223,11 @@ int zaxisCreate(int zaxistype, int size)
double *vals;
zaxis_t *zaxisptr;
if ( CDI_Debug )
Message("zaxistype: %d size: %d ", zaxistype, size);
if ( CDI_Debug ) Message("zaxistype=%s levels=%d", zaxisNamePtr(zaxistype), size);
zaxisInit ();
if ( size < 0 ) Error("Negativ number of levels (%d) not allowed!", size);
zaxisInit();
zaxisptr = zaxisNewEntry();
......@@ -249,8 +250,7 @@ int zaxisCreate(int zaxistype, int size)
vals = (double *) malloc(size*sizeof(double));
for ( ilev = 0; ilev < size; ilev++ )
vals[ilev] = 0.0;
for ( ilev = 0; ilev < size; ilev++ ) vals[ilev] = 0.0;
zaxisptr->vals = vals;
......
Markdown is supported
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