All pastes #222854 Raw Edit

Someone

public c v1 · immutable
#222854 ·published 2006-10-26 16:15 UTC
rendered paste body
void   read_stdin(int   octets){  char *stock;  int   fd;  int   tmp;  stock = malloc(sizeof(*stock)*octets);  fd = read(0, stock, octets);  if (fd == -1)    {      write(2, "Error1", 6);    }  tmp = write(1, stock, octets);  if (tmp == -1)    write(2, "Error2", 6);}int     main(int argc, char **argv){  if (argc > 1)    read_stdin(my_getnbr(argv[1]));  else    write(2, "Error3", 6);  return (0);}