diff -up g2clib-1.6.0.p12/simunpack.c g2clib-1.6.0.p123/simunpack.c --- g2clib-1.6.0.p12/simunpack.c 2017-08-13 10:24:02.266764550 +0200 +++ g2clib-1.6.0.p123/simunpack.c 2017-08-13 10:50:49.881774231 +0200 @@ -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);