IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 27, 2016, 12:06:28 PM (10 years ago)
Author:
eugene
Message:

do not segfault on missing hostID

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20160809/Ohana/src/opihi/dvo/skycat.c

    r39457 r39725  
    7878      if (table) {
    7979        int hostID = (regions[i][0].hostFlags & DATA_USE_BCK) ? regions[i][0].backupID : regions[i][0].hostID;
    80         int index = table->index[hostID];
    81         snprintf (hostfile, 1024, "%s/%s.cpt", table->hosts[index].pathname, regions[i][0].name);
     80        if (hostID) {
     81          int index = table->index[hostID];
     82          snprintf (hostfile, 1024, "%s/%s.cpt", table->hosts[index].pathname, regions[i][0].name);
     83        } else {
     84          strcpy (hostfile, skylist[0].filename[i]);
     85        }
    8286      } else {
    8387        strcpy (hostfile, skylist[0].filename[i]);
Note: See TracChangeset for help on using the changeset viewer.