[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nc_{put,get}_vara_*() start & edge arguments. address@hidden



Harvey:

As I understand it, the case you got a core dump on was a get_vara or
put_vara of scalar variable.

At any rate, code inspection shows that the released netcdf-3.1a
has an error in that it is attempting to check the 'edges' argument
for scalar variables. It should just ignore this argument (and the
'begin' argument) for this case.

At the end of this message find a patch to putget.m4.

-glenn
Index: putget.m4
===================================================================
RCS file: /upc/share/CVS/netcdf-3/libsrc/putget.m4,v
retrieving revision 2.21
retrieving revision 2.22
diff -c -r2.21 -r2.22
*** putget.m4   1996/08/23 17:58:36     2.21
--- putget.m4   1996/10/22 20:39:38     2.22
***************
*** 12,18 ****
   *    Copyright 1996, University Corporation for Atmospheric Research
   *      See netcdf/COPYRIGHT file for copying and redistribution conditions.
   */
! /* $Id: putget.m4,v 2.21 1996/08/23 17:58:36 davis Exp $ */
  
  #include "nc.h"
  #include <string.h>
--- 12,18 ----
   *    Copyright 1996, University Corporation for Atmospheric Research
   *      See netcdf/COPYRIGHT file for copying and redistribution conditions.
   */
! /* $Id: putget.m4,v 2.22 1996/10/22 20:39:38 davis Exp $ */
  
  #include "nc.h"
  #include <string.h>
***************
*** 389,394 ****
--- 389,397 ----
  {
        const size_t *const end = start + varp->ndims;
        const size_t *shp = varp->shape;
+ 
+       if(varp->ndims == 0)
+               return NC_NOERR;        /* 'scalar' variable */
  
        if(IS_RECVAR(varp))
        {