#include <malloc.h>
#include <stdio.h>
#include <string.h>

main(int argc, char *argv[])
{
  FILE *infile;
  char *buf;
  size_t size;
  int nbytes;

  buf = malloc(200);
  size = 200;

  infile = fopen(argv[1], "r");
  do {
    memset(buf, 0, size);
    nbytes = getline(&buf, &size, infile);
    printf("line %s\n", buf);
  } while (nbytes >0);

  free(buf);
}
