IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 20, 2018, 8:58:31 PM (8 years ago)
Author:
eugene
Message:

add snprintf_nowarn function to avoid compiler warnings from desired snprint truncations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libfits/matrix/F_uncompress_M.c

    r39457 r40549  
    9898    gfits_delete (header, "ZTILE1", 1);
    9999    for (axis = 1; axis < header->Naxes; axis++) {
    100       snprintf (key, 10, "ZTILE%d", axis + 1);
     100      snprintf (key, 10, "ZTILE%d", axis + 1); 
    101101      if (!gfits_scan (header, key, "%lu", 1, &ztile[axis])) ESCAPE;
    102102      gfits_delete (header, key, 1);
     
    110110  ALLOCATE (optvalue, char *, NOPTIONS);
    111111  for (Noptions = 0; TRUE; Noptions++) {
    112     snprintf (key, 10, "ZNAME%d", Noptions + 1);
     112    snprintf_nowarn (key, 10, "ZNAME%d", Noptions + 1);
    113113    if (!gfits_scan (header, key, "%s", 1, word)) break;
    114114    gfits_delete (header, key, 1);
    115115    optname[Noptions] = strcreate (word);
    116116
    117     snprintf (key, 10, "ZVAL%d", Noptions + 1);
     117    snprintf_nowarn (key, 10, "ZVAL%d", Noptions + 1);
    118118    if (!gfits_scan (header, key, "%s", 1, word)) ESCAPE;
    119119    gfits_delete (header, key, 1);
     
    204204  int colnum;
    205205  for (colnum = 1; TRUE; colnum++) {
    206     snprintf (key, 10, "TTYPE%d", colnum);
     206    snprintf_nowarn (key, 10, "TTYPE%d", colnum);
    207207    if (!gfits_scan (ftable->header, key, "%s", 1, word)) ESCAPE;
    208208    if (!strcmp (word, "COMPRESSED_DATA")) break;
     
    212212  if (!gfits_varlength_column_define (ftable, &zdef, zcol)) ESCAPE;
    213213  gfits_delete (header, "TFIELDS", 1);
    214   snprintf (key, 10, "TTYPE"OFF_T_FMT,  zcol);
     214  snprintf_nowarn (key, 10, "TTYPE"OFF_T_FMT,  zcol);
    215215  gfits_delete (header, key, 1);
    216   snprintf (key, 10, "TFORM"OFF_T_FMT,  zcol);
     216  snprintf_nowarn (key, 10, "TFORM"OFF_T_FMT,  zcol);
    217217  gfits_delete (header, key, 1);
    218218
Note: See TracChangeset for help on using the changeset viewer.