IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34220


Ignore:
Timestamp:
Jul 30, 2012, 5:03:34 PM (14 years ago)
Author:
watersc1
Message:

Edit to ensure that the boxid array is initialized to -1, and that any values still with -1 are skipped in the union case. I'm not totally sure this is the best solution, but it will at least prevent segfaults.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/extsrc/gpcsw/gpcsrc/fits/burntool/persistio.c

    r26766 r34220  
    132132/* Assess the clustering of all the streaks */
    133133   for(i=0; i<MAXSIZE; i++) xusage[i] = 0;
     134   for(i=0; i<MAXSIZE; i++) boxid[i] = -1;
    134135   for(k=0; k<nbox; k++) {
    135136      if(box[k].exfit >= MAXSIZE-1) continue;
     
    188189         for(jp=kp+1; jp<n; jp++) {
    189190            j = boxid[jp];
     191            /* CZW: Since I added the initialization statement above, */
     192            /*      any box with boxid == -1 hasn't been set, and */
     193            /*      therefore needs to be dropped, I think. */
     194            if ((k < 0)||(j < 0)) { continue; }
    190195            if(ABS(yctr[jp]-yctr[kp]) <= DIFFERENT_STREAK) {
    191196/* Merge k into j, trash k from further consideration */
Note: See TracChangeset for help on using the changeset viewer.