- tomove = req = hasread - berlen;
- rest = tomove % CS_TCPIP_BUFCHUNK;
- if (rest)
- req += CS_TCPIP_BUFCHUNK - rest;
- if (!sp->altbuf)
- {
- if (!(sp->altbuf = malloc(sp->altsize = req)))
- return -1;
- } else if (sp->altsize < req)
- if (!(sp->altbuf = realloc(sp->altbuf, sp->altsize = req)))
- return -1;
- TRC(fprintf(stderr, " Moving %d bytes to altbuf(0x%x)\n", tomove,
- (unsigned) sp->altbuf));
- memcpy(sp->altbuf, *buf + berlen, sp->altlen = tomove);
+ tomove = req = hasread - berlen;
+ rest = tomove % CS_TCPIP_BUFCHUNK;
+ if (rest)
+ req += CS_TCPIP_BUFCHUNK - rest;
+ if (!sp->altbuf)
+ {
+ if (!(sp->altbuf = xmalloc(sp->altsize = req)))
+ return -1;
+ } else if (sp->altsize < req)
+ if (!(sp->altbuf =xrealloc(sp->altbuf, sp->altsize = req)))
+ return -1;
+ TRC(fprintf(stderr, " Moving %d bytes to altbuf(0x%x)\n", tomove,
+ (unsigned) sp->altbuf));
+ memcpy(sp->altbuf, *buf + berlen, sp->altlen = tomove);