Changeset 3654 in Sophya for trunk/SophyaExt/XephemAstroLib/bdl.c


Ignore:
Timestamp:
Jul 16, 2009, 12:34:39 PM (16 years ago)
Author:
cmv
Message:

mise a niveau Xephem 3.7.4, cmv 16/07/2009

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/XephemAstroLib/bdl.c

    r3477 r3654  
    115115        char *bp;
    116116
    117         if (buf && width != (int)fread (buf, 1, width, fp)) {
    118             if (ferror(fp)) strcpy (ynot, "IO error");
    119             else if (feof(fp)) strcpy (ynot, "unexpected EOF");
    120             else strcpy (ynot, "short file");
     117        if (width > sizeof(buf)-1) {
     118            sprintf (ynot, "BDL Field width %d > %d", width, (int)sizeof(buf));
     119            return (-1);
     120        }
     121        if (width != (int)fread (buf, 1, width, fp)) {
     122            if (ferror(fp)) strcpy (ynot, "BDL IO error");
     123            else if (feof(fp)) strcpy (ynot, "BDL unexpected EOF");
     124            else strcpy (ynot, "BDL short file");
    121125            return (-1);
    122126        }
     
    232236
    233237/* For RCS Only -- Do Not Edit */
    234 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: bdl.c,v $ $Date: 2008-03-25 17:45:11 $ $Revision: 1.5 $ $Name: not supported by cvs2svn $"};
     238static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: bdl.c,v $ $Date: 2009-07-16 10:34:36 $ $Revision: 1.6 $ $Name: not supported by cvs2svn $"};
Note: See TracChangeset for help on using the changeset viewer.