Changeset 406 for trunk/dll/command.c


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

Use xfgets_bstripcr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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__);
Note: See TracChangeset for help on using the changeset viewer.