Commit 8fe9ec4a authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdilib.c::defineAttributes: bug fix atttxt

parent 02d1ac54
2011-10-27 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cdilib.c::defineAttributes: bug fix atttxt [report: Florian Prill]
2011-10-25 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* added support for netcdf attribute valid_range [request: Etienne Tourigny]
......
......@@ -446,7 +446,6 @@ void defineAttributes(int vlistID, int varID, int fileID, int ncvarID)
int atttype, attlen;
size_t len;
char attname[1024];
char atttxt[8192];
vlistInqNatts(vlistID, varID, &natts);
......@@ -456,9 +455,12 @@ void defineAttributes(int vlistID, int varID, int fileID, int ncvarID)
if ( atttype == DATATYPE_TXT )
{
vlistInqAttTxt(vlistID, varID, attname, sizeof(atttxt), atttxt);
char *atttxt;
atttxt = (char *) malloc(attlen*sizeof(char));
vlistInqAttTxt(vlistID, varID, attname, attlen, atttxt);
len = attlen;
cdf_put_att_text(fileID, ncvarID, attname, len, atttxt);
free(atttxt);
}
else if ( atttype == DATATYPE_INT16 || atttype == DATATYPE_INT32 )
{
......
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