library/comms.c
static int read_block(int fd, char **buffer)
{
  int size = 0;

  readn(fd, &size, sizeof (int));
  if (size == 0) {
    *buffer = NULL;
    return 0;
  }
  *buffer = xmalloc(size);
  readn(fd, *buffer, size);
  if ((*buffer)[size-1]) {
    warnx("read_block: input is not null-terminated");
    return -2;
  }
  return size;
}
// Read variable recorded-size block from file descriptor
Read variable recorded-size block from file descriptor
Read variable recorded - size block from file descriptor
static int read_block(int fd, char **buffer)
{
  int size = 0;
  readn(fd, &size, sizeof (int));
  if (size == 0) {
    *buffer = NULL;
    return 0;
  }
  *buffer = xmalloc(size);
  readn(fd, *buffer, size);
  if ((*buffer)[size-1]) {
    warnx("read_block: input is not null-terminated");
    return -2;
  }
  return size;
}
static int read_block ( int fd , char * * buffer ) { int size = 0 ; readn ( fd , & size , sizeof ( int ) ) ; if ( size == 0 ) { * buffer = NULL ; return 0 ; } * buffer = xmalloc ( size ) ; readn ( fd , * buffer , size ) ; if ( ( * buffer ) [ size - 1 ] ) { warnx ( " " ) ; return -2 ; } return size ; }
Read variable recorded-size block from file descriptor
Read variable recorded - size block from file descriptor