Changeset 5375


Ignore:
Timestamp:
May 28, 2008, 4:11:12 PM (16 years ago)
Author:
ole
Message:

Comments from Ole in regard to uninitialised pointer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/urs_ext.c

    r5348 r5375  
    255255   fread(lros,nsta0*sizeof(int),1,fp);
    256256
    257       /* compute the size of the data block for source 0 */   
     257   /* compute the size of the data block for source 0 */   
    258258   numData = getNumData(fros, lros, nsta0);
    259259
    260260   /* Burbidge: Added a sanity check here */
    261       if (numData < 0)
    262         {
    263           fprintf(stderr,"Size of data block appears to be negative!\n");
    264           //fprintf(stderr,"numData=%d fros=%d lros=%d nsta0=%d\n",numData,fros,lros,nsta0);
    265           exit(-1);
    266         }
    267 
     261   if (numData < 0) {
     262     fprintf(stderr,"Size of data block appears to be negative!\n");
     263     //fprintf(stderr,"numData=%d fros=%d lros=%d nsta0=%d\n",numData,fros,lros,nsta0);
     264     exit(-1);
     265   }
     266   
    268267   /* allocate space for these data, read them and close the file */   
    269268   *muxData = (float*) malloc(numData*sizeof(float));
     
    274273      /* allocate space for tgsrwg for the other sources */
    275274      mytgs = (struct tgsrwg *)malloc( nsta0*sizeof(struct tgsrwg) );
    276    }
     275   } else {
     276     /* FIXME (Ole): What should happen in case the are no source files?*/
     277     /* If we exit here, tests will break */
     278     // fprintf(stderr, "No source file specified\n");
     279     // exit(-1);       
     280   }
     281   
    277282   /* loop over sources, check compatibility, and read them into *muxData */
    278283   for(isrc=1; isrc<numSrc; isrc++){
Note: See TracChangeset for help on using the changeset viewer.