Changeset 406 for trunk


Ignore:
Timestamp:
Jul 29, 2006, 10:02:17 PM (19 years ago)
Author:
root
Message:

Use xfgets_bstripcr

Location:
trunk/dll
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r377 r406  
    2626  14 Jul 06 SHL Use Runtime_Error
    2727  26 Jul 06 SHL Correct SelectAll usage
     28  29 Jul 06 SHL Use xfgets_bstripcr
    2829
    2930***********************************************************************/
     
    431432
    432433      while(!feof(fp) && !gotend) {
    433         if(!fgets(s,CCHMAXPATH * 2,fp))
     434        if(!xfgets_bstripcr(s,sizeof(s),fp,pszSrcFile,__LINE__))
    434435          break;
    435         s[(CCHMAXPATH * 2) - 1] = 0;
    436         stripcr(s);
    437436        if(!gotstart) {
    438437          if (!strcmp(s,info->startlist))
     
    450449            lonename[CCHMAXPATH + 1] = 0;
    451450            fname = lonename;
    452             if(!fgets(s,CCHMAXPATH * 2,fp))
     451            if(!xfgets_bstripcr(s,sizeof(s),fp,pszSrcFile,__LINE__))
    453452              break;
    454             s[(CCHMAXPATH * 2) - 1] = 0;
    455             bstripcr(s);
    456453            if(*fname == '\"') {
    457454              memmove(fname,fname + 1,strlen(fname) + 1);
     
    534531            }
    535532          }
    536           if(info->nameisnext) {
    537             if(!fgets(lonename,CCHMAXPATH + 2,fp))
     533          if (info->nameisnext) {
     534            if (!xfgets_bstripcr(lonename,sizeof(lonename),fp,pszSrcFile,__LINE__))
    538535              break;
    539             lonename[CCHMAXPATH + 1] = 0;
    540             bstripcr(lonename);
    541536            fname = lonename;
    542537          }
    543           if(fname && *fname) {
     538          if (fname && *fname) {
    544539
    545540            RECORDINSERT ri;
  • trunk/dll/cmdline.c

    r345 r406  
    1212  05 Jun 05 SHL Use QWL_USER
    1313  22 Jul 06 SHL Check more run time errors
     14  29 Jul 06 SHL Use xfgets_bstripcr
    1415
    1516***********************************************************************/
     
    6768  if (fp) {
    6869    while (x < MAXNUMCLS && !feof(fp)) {
    69       if (!fgets(s,sizeof(s),fp))
     70      if (!xfgets_bstripcr(s,sizeof(s),fp,pszSrcFile,__LINE__))
    7071        break;
    71       s[sizeof(s) - 1] = 0;
    72       bstripcr(s);
    7372      if (*s && *s != ';') {
    7473        info = xmalloc(sizeof(LINKCLS), pszSrcFile, __LINE__);
  • trunk/dll/command.c

    r347 r406  
    1212  06 Jun 05 SHL Drop unused code
    1313  14 Jul 06 SHL Use Runtime_Error
     14  29 Jul 06 SHL Use xfgets_bstripcr
    1415
    1516***********************************************************************/
     
    334335  fp = _fsopen(cl,"r",SH_DENYWR);
    335336  if(fp) {
    336     while(!feof(fp)) {
    337       if(!fgets(title,100,fp))
     337    while (!feof(fp)) {
     338      if (!xfgets_bstripcr(title,sizeof(title),fp,pszSrcFile,__LINE__))
    338339        break;
    339       title[34] = 0;
     340      title[34] = 0;                    // fixme to know why chopped this way?
    340341      bstripcr(title);
    341       if(!*title || *title == ';')
     342      if (!*title || *title == ';')
    342343        continue;
    343       if(!fgets(cl,1024,fp) ||
    344          !fgets(flags,72,fp))
     344      if (!xfgets(cl,sizeof(cl),fp,pszSrcFile,__LINE__))
    345345        break;                       /* error! */
    346       cl[1000] = 0;
     346      if (!xfgets(flags,72,fp,pszSrcFile,__LINE__))
     347        break;                       /* error! */
     348      cl[1000] = 0;                     // fixme to know why chopped this way?
     349      bstripcr(cl);
    347350      flags[34] = 0;
    348       bstripcr(cl);
    349351      bstripcr(flags);
    350352      if(!*cl)
    351353        continue;
    352354      info = xmallocz(sizeof(LINKCMDS),pszSrcFile,__LINE__);
    353       if(info) {
     355      if (info) {
    354356        info->cl = xstrdup(cl,pszSrcFile,__LINE__);
    355357        info->title = xstrdup(title,pszSrcFile,__LINE__);
  • trunk/dll/comp.c

    r378 r406  
    1919  13 Jul 06 SHL Use Runtime_Error
    2020  26 Jul 06 SHL Drop unreachable CN_... code
     21  29 Jul 06 SHL Use xfgets_bstripcr
    2122
    2223***********************************************************************/
     
    827828          Runtime_Error(pszSrcFile, __LINE__, "can not open %s (%d)", cmp->rightlist, errno);
    828829        else {
    829           while(!feof(fp)) {
     830          while (!feof(fp)) {
    830831            /* first get name of directory */
    831             if(!fgets(str,sizeof(str) - 1,fp))
     832            if (!xfgets_bstripcr(str,sizeof(str),fp,pszSrcFile,__LINE__))
    832833              break;            // EOF
    833             str[sizeof(str) - 1] = 0;
    834             bstrip(str);
    835834            p = str;
    836835            if(*p == '\"') {
     
    869868            lenr = strlen(cmp->rightdir) +
    870869                     (cmp->rightdir[strlen(cmp->rightdir) - 1] != '\\');
    871             while(!feof(fp)) {
    872               if(!fgets(str,sizeof(str) - 1,fp))
     870            while (!feof(fp)) {
     871              if (!xfgets_bstripcr(str,sizeof(str),fp,pszSrcFile,__LINE__))
    873872                break;
    874               str[sizeof(str) - 1] = 0;
    875               bstrip(str);
    876873              p = str;
    877874              if(*p == '\"') {
  • trunk/dll/filter.c

    r377 r406  
    99  01 Aug 04 SHL Rework lstrip/rstrip usage
    1010  22 Jul 06 SHL Check more run time errors
     11  29 Jul 06 SHL Use xfgets_bstripcr
    1112
    1213***********************************************************************/
     
    128129  fp = _fsopen(s,"r",SH_DENYWR);
    129130  if(fp) {
    130     while(!feof(fp)) {
    131       if(!fgets(s,sizeof(s),fp))
     131    while (!feof(fp)) {
     132      if (!xfgets_bstripcr(s,sizeof(s),fp,pszSrcFile,__LINE__))
    132133        break;
    133       s[sizeof(s) - 1] = 0;
    134       bstripcr(s);
    135134      if(*s && *s != ';') {
    136135        info = xmalloc(sizeof(LINKMASKS),pszSrcFile,__LINE__);
  • trunk/dll/menu.c

    r356 r406  
    1111  01 Aug 04 SHL Rework lstrip/rstrip usage
    1212  22 Jul 06 SHL Check more run time errors
     13  29 Jul 06 SHL Use xfgets_bstripcr
    1314
    1415***********************************************************************/
     
    99100  else {
    100101    while (!feof(fp)) {
    101       if (!fgets(s,256,fp))
     102      if (!xfgets_bstripcr(s,sizeof(s),fp,pszSrcFile,__LINE__))
    102103        break;
    103104      lines++;
    104       bstripcr(s);
    105105      if(!*s || *s == ';')
    106106        continue;
  • trunk/dll/misc.c

    r397 r406  
    44  $Id$
    55
    6   Misc support functions
     6  Misc GUI support functions
    77
    88  Copyright (c) 1993-98 M. Kimes
     
    1818  26 Jul 06 SHL Use chop_at_crnl
    1919  27 Jul 06 SHL Comments, apply indent
     20  29 Jul 06 SHL Use xfgets_bstripcr
    2021
    2122***********************************************************************/
     
    18161817    if (fp) {
    18171818      while (!feof(fp)) {
    1818         if (!fgets(var, 8192, fp))
     1819        if (!xfgets_bstripcr(var, sizeof(var), fp,pszSrcFile,__LINE__))
    18191820          break;
    1820         var[8191] = 0;
    1821         bstripcr(var);
    18221821        if (!strnicmp(var, "LIBPATH=", 8)) {
    18231822          memmove(var, var + 8, strlen(var + 8) + 1);
  • trunk/dll/select.c

    r362 r406  
    1414  06 Jul 06 SHL Support compare content (IDM_SELECTSAMECONTENT)
    1515  13 Jul 06 SHL Use Runtime_Error
     16  29 Jul 06 SHL Use xfgets_bstripcr
    1617
    1718***********************************************************************/
     
    107108    if (fp) {
    108109      while (!feof(fp)) {
    109         if (!fgets(input,1024,fp))
     110        if (!xfgets_bstripcr(input,sizeof(input),fp,pszSrcFile,__LINE__))
    110111          break;
    111         input[1023] = 0;
    112         bstripcr(input);
    113112        if (*input == '\"') {
    114113          memmove(input,input + 1,strlen(input) + 1);
  • trunk/dll/undel.c

    r382 r406  
    1010  24 May 05 SHL Rework Win_Error usage
    1111  17 Jul 06 SHL Use Runtime_Error
     12  29 Jul 06 SHL Use xfgets_bstripcr
    1213
    1314***********************************************************************/
     
    99100    fp = xfopen("$UDELETE.#$#","r",pszSrcFile,__LINE__);
    100101    if (fp) {
    101       fgets(s,CCHMAXPATH + 128,fp);
    102       while(!feof(fp)) {
     102      xfgets(s,sizeof(s),fp,pszSrcFile,__LINE__);       // Skip 1st line
     103      while (!feof(fp)) {
    103104        strset(s,0);
    104         if(!fgets(s,CCHMAXPATH + 2,fp))
    105           break;
    106         bstripcr(s);
     105        if (!xfgets_bstripcr(s,CCHMAXPATH + 2,fp,pszSrcFile,__LINE__))
     106          break;
    107107        if(*s) {
    108108          if(!strnicmp(s,"SYS3194: ",9)) {
     
    111111
    112112            strcat(s," ");
    113             fgets(&s[strlen(s)],(CCHMAXPATH + 128) - strlen(s),fp);
     113            xfgets(&s[strlen(s)],CCHMAXPATH + 128 - strlen(s),fp,pszSrcFile,__LINE__);
    114114            fclose(fp);
    115115            s[CCHMAXPATH + 128] = 0;
Note: See TracChangeset for help on using the changeset viewer.