Skip to content

Instantly share code, notes, and snippets.

@jgajek
Created March 28, 2016 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgajek/5954bb0f6e057c88c2d5 to your computer and use it in GitHub Desktop.
Save jgajek/5954bb0f6e057c88c2d5 to your computer and use it in GitHub Desktop.
if (*thisanssizp < MAXPACKET
/* Yes, we test ANSCP here. If we have two buffers
both will be allocatable. */
&& anscp
#ifdef FIONREAD
&& (ioctl (pfd[0].fd, FIONREAD, thisresplenp) < 0
|| *thisanssizp < *thisresplenp)
#endif
) {
u_char *newp = malloc (MAXPACKET);
if (newp != NULL) {
*anssizp = MAXPACKET;
*thisansp = ans = newp;
if (thisansp == ansp2)
*ansp2_malloced = 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment