Blob Blame History Raw
diff -up g2clib-1.4.0/simunpack.c.simunpack g2clib-1.4.0/simunpack.c
--- g2clib-1.4.0/simunpack.c.simunpack	2012-02-15 06:54:38.000000000 -0700
+++ g2clib-1.4.0/simunpack.c	2013-01-10 14:00:43.687093900 -0700
@@ -49,7 +49,7 @@ g2int simunpack(unsigned char *cpack,g2i
       nbits = idrstmpl[3];
       itype = idrstmpl[4];
 
-      ifld=(g2int *)calloc(ndpts,sizeof(g2int));
+      ifld=(g2int *)calloc((ndpts ? ndpts : 1),sizeof(g2int));
       if ( ifld == 0 ) {
          fprintf(stderr,"Could not allocate space in simunpack.\n  Data field NOT upacked.\n");
          return(1);