Esempio n. 1
0
int main ()
{
  char out [INSZ];
  int out_l;
  bool dirmode;
  static const char npf[] = NPF;
  const int npfsize = NPFSZ;
  int c;

  dirmode = false;

  out_l = 0;
  out[INSZ-1] = EOS;

 top:

  while((c = nondet_int()) != EOF) {
    if(c == '\r')
      c = '\n';
    if(c == '\n') {
      if(dirmode) {
        ftpls(out);
      } else {
        if(!out_l)
          continue;
        /* This assertion is meant to stop SatAbs from going insane 
         * and reporting a spurious error in strcmp. Which it still
         * does. :-/
         * 
         */
        assert (out_l <= INSZ-1);
        if (out_l > npfsize && !strcmp(out + out_l - npfsize, npf)) {
          dirmode = true;
          goto top;
        }
      }
      out_l = 0;
    } else {
      out_l++;
      if (out_l > INSZ-1)
        return ERR;
    }
  }

  return 0;
}
Esempio n. 2
0
int main ()
{
  char out [INSZ];
  int out_l;
  bool dirmode;
  static const char npf[] = NPF;
  const int npfsize = NPFSZ;
  int c;

  dirmode = false;

  out_l = 0;
  out[INSZ-1] = EOS;

 top:

  while((c = nondet_int()) != EOF) {
    if(c == '\r')
      c = '\n';
    if(c == '\n') {
      if(dirmode) {
        ftpls(out);
      } else {
        if(!out_l)
          continue;
        if (out_l > npfsize) {
          dirmode = true;
          goto top;
        }
      }
      out_l = 0;
    } else {
      out[out_l] = c;
      out_l++;
      if (out_l > INSZ-1)
        return ERR;
    }
  }

  return 0;
}
int main(void) 
{ char out[((256 + 1) + 2) + 2] ;
  int out_l ;
  int dirmode ;
  int npfsize ;
  int c ;
  int __retres ;
  
  {npfsize = 1;
  dirmode = 0;
  out_l = 0;
  out[(((256 + 1) + 2) + 2) - 1] = (char)0;
  top: 
  while (1) {c = taint();
    if (! (c != -1)) {break;}
    
    if (c == '\r') {c = '\n';}
    
    if (c == '\n')
    {if (dirmode) {ftpls(out);}
     else {if (! out_l) {continue;}
     
     if (out_l > npfsize) {dirmode = 1;
       goto top;}
     }
    
    out_l = 0;}
    else {/* STAC: BAD */
    out[out_l] = (char )c;
    out_l ++;
    if (out_l > (((256 + 1) + 2) + 2) - 1) {__retres = -1;
      goto return_label;}
    }
    }
  
  __retres = 0;
  return_label: /* CIL Label */ 
  return (__retres);}

}
Esempio n. 4
0
int main ()
{
  char out [INSZ];
  int out_l;
  int dirmode;
  static const char npf[] = NPF;
  const int npfsize = NPFSZ;
  int c;

  dirmode = 0;

  out_l = 0;
  out[INSZ-1] = EOS;

 top:

  while((c = taint()) != EOF) {
    if(c == '\r')
      c = '\n';
    if(c == '\n') {
      if(dirmode) {
        ftpls(out);
      } else {
        if(!out_l)
          continue;
        if (out_l > npfsize && !strcmp(out + out_l - npfsize, npf)) {
          dirmode = 1;
          goto top;
        }
      }
      out_l = 0;
    } else {
      out_l++;
      if (out_l > INSZ-1)
        return ERR;
    }
  }

  return 0;
}