*n = needed; *lineptr = (char *) realloc (*lineptr, needed); if (*lineptr == NULL)
new_lineptr = (char *) realloc (*lineptr, needed); if (new_lineptr == NULL)
_IO_getdelim (lineptr, n, delimiter, fp)     char **lineptr;     _IO_size_t *n;     int delimiter;     _IO_FILE *fp;{  int result;  _IO_ssize_t cur_len = 0;  _IO_ssize_t len;  if (lineptr == NULL || n == NULL)    {      MAYBE_SET_EINVAL;      return -1;    }  CHECK_FILE (fp, -1);  _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);  _IO_flockfile (fp);  if (_IO_ferror_unlocked (fp))    {      result = -1;      goto unlock_return;    }  if (*lineptr == NULL || *n == 0)    {      *n = 120;      *lineptr = (char *) malloc (*n);      if (*lineptr == NULL)	{	  result = -1;	  goto unlock_return;	}    }  len = fp->_IO_read_end - fp->_IO_read_ptr;  if (len <= 0)    {      if (__underflow (fp) == EOF)	{	  result = -1;	  goto unlock_return;	}      len = fp->_IO_read_end - fp->_IO_read_ptr;    }  for (;;)    {      _IO_size_t needed;      char *t;      t = (char *) memchr ((void *) fp->_IO_read_ptr, delimiter, len);      if (t != NULL)	len = (t - fp->_IO_read_ptr) + 1;      /* Make enough space for len+1 (for final NUL) bytes.  */      needed = cur_len + len + 1;      if (needed > *n)	{	  if (needed < 2 * *n)	    needed = 2 * *n;  /* Be generous. */	  *n = needed;	  *lineptr = (char *) realloc (*lineptr, needed);	  if (*lineptr == NULL)	    {	      result = -1;	      goto unlock_return;	    }	}      memcpy (*lineptr + cur_len, (void *) fp->_IO_read_ptr, len);      fp->_IO_read_ptr += len;      cur_len += len;      if (t != NULL || __underflow (fp) == EOF)	break;      len = fp->_IO_read_end - fp->_IO_read_ptr;    }  (*lineptr)[cur_len] = '\0';  result = cur_len;unlock_return:  _IO_funlockfile (fp);  _IO_cleanup_region_end (0);  return result;}