All pastes #259072 Raw Edit

Anonymous

public text v1 · immutable
#259072 ·published 2006-11-27 02:16 UTC
rendered paste body
#define BUFF_SIZE 42
#define READ_SIZE 42

char    *get_next_line(const int fd)
{
  static char   buff_read[BUFF_SIZE];
  static int    repeat;
  static int    i;

  i =  0;
  repeat = read(fd, buff_read, READ_SIZE);
  while (42)
    {
      while (buff_read[i])
        {
          if (buff_read[i] == '\0')
            return (0);
          else
            if (buff_read[i] == '\n')
              return (0);
            else
              if (BUFF_SIZE <= i)
                return (0);
              else
                if (READ_SIZE <= i)
                  return (0);
                else
                  my_putchar(buff_read[i]);
          i++;
        }
    }
}

int     main()
{
  get_next_line(0);
  get_next_line(0);
}