Ignore:
Timestamp:
01/14/03 13:48:11 (22 years ago)
Author:
blanch
Message:
It fixes some bugs while reading skycatalogue.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Detector/Starfield/star.cxx

    r342 r1707  
    2929  char c8[9];
    3030
     31  strncpy(c2+2, "\0", 1);
     32  strncpy(c3+3, "\0", 1);
     33  strncpy(c6+6, "\0", 1);
     34  strncpy(c7+7, "\0", 1);
     35  strncpy(c8+8, "\0", 1);
     36
    3137  pos = catline;
    3238
     
    3844
    3945  pos = catline + 27;
     46
     47
    4048  strncpy(c8, pos, 8);
    4149  sscanf(c8, "%d", &icatnum);
     
    7381  pos = catline + 231;
    7482  strncpy(c6, pos, 6);
    75   sscanf(c6, "%f", &vmag);
     83  if (sscanf(c6, "%f", &vmag) < 1)
     84    vmag = -999.;;
    7685
    7786  pos = catline + 251;
    7887  strncpy(c6, pos, 6);
    79   sscanf(c6, "%f", &bmag);
     88  if (sscanf(c6, "%f", &bmag) < 1)
     89    bmag = -999.;
    8090
    8191  pos = catline + 271;
    8292  strncpy(c6, pos, 6);
    83   sscanf(c6, "%f", &umag);
     93  if (sscanf(c6, "%f", &umag) < 1)
     94    umag = -999.;
    8495
    8596  ra_h = ira_hours + ira_min/60. + ra_sec/3600.;
Note: See TracChangeset for help on using the changeset viewer.