Changeset 401


Ignore:
Timestamp:
Jul 29, 2006, 9:53:05 PM (19 years ago)
Author:
root
Message:

Use xfgets, xfgets_bstripcr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/dll/tools.c

    r329 r401  
    1212  23 May 05 SHL Use QWL_USER
    1313  22 Jul 06 SHL Check more run time errors
     14  29 Jul 06 SHL Use xfgets, xfgets_bstripcr
    1415
    1516***********************************************************************/
     
    6364  if (fp) {
    6465    while(x < 50 && !feof(fp)) {
    65       if(!fgets(s,CCHMAXPATH + 2,fp))
     66      if(!xfgets_bstripcr(s,CCHMAXPATH + 2,fp,pszSrcFile,__LINE__))
    6667        break;
    67       s[CCHMAXPATH - 1] = 0;
    68       bstripcr(s);
    6968      if(*s && *s != ';') {
    7069        quicktool[x] = xstrdup(s,pszSrcFile,__LINE__);
     
    102101
    103102  FILE  *fp;
    104   CHAR   help[81],text[81],flagstr[81],idstr[81],*fname;
     103  CHAR   help[80],text[80],flagstr[80],idstr[80],*fname;
    105104  TOOL  *info;
    106105
     
    126125      while(!feof(fp)) {
    127126        do {
    128           if(!fgets(help,80,fp))
     127          if(!xfgets(help,sizeof(help),fp,pszSrcFile,__LINE__))
    129128            break;
    130129        } while(*help == ';' && !feof(fp));
    131130        stripcr(help);
    132         if(!fgets(text,80,fp))
     131        if(!xfgets(text,sizeof(text),fp,pszSrcFile,__LINE__))
    133132          break;
    134133        stripcr(text);
    135         if(!fgets(flagstr,80,fp))
    136           break;
    137         if(!fgets(idstr,80,fp))
     134        if(!xfgets(flagstr,sizeof(flagstr),fp,pszSrcFile,__LINE__))
     135          break;
     136        if(!xfgets(idstr,sizeof(idstr),fp,pszSrcFile,__LINE__))
    138137          break;
    139138        if(!(USHORT)atoi(idstr))
Note: See TracChangeset for help on using the changeset viewer.