Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 721566 | Differences between
and this patch

Collapse All | Expand All

(-)a/qmail.c (-1 / +1 lines)
Lines 61-67 void qmail_fail(qq) struct qmail *qq; Link Here
61
  qq->flagerr = 1;
61
  qq->flagerr = 1;
62
}
62
}
63
63
64
void qmail_put(qq,s,len) struct qmail *qq; char *s; int len;
64
void qmail_put(qq,s,len) struct qmail *qq; char *s; unsigned int len;
65
{
65
{
66
  if (!qq->flagerr) if (substdio_put(&qq->ss,s,len) == -1) qq->flagerr = 1;
66
  if (!qq->flagerr) if (substdio_put(&qq->ss,s,len) == -1) qq->flagerr = 1;
67
}
67
}
(-)a/substdo.c (-7 / +8 lines)
Lines 7-13 static int allwrite(op,fd,buf,len) Link Here
7
register int (*op)();
7
register int (*op)();
8
register int fd;
8
register int fd;
9
register char *buf;
9
register char *buf;
10
register int len;
10
register unsigned int len;
11
{
11
{
12
  register int w;
12
  register int w;
13
13
Lines 55-70 register int len; Link Here
55
int substdio_put(s,buf,len)
55
int substdio_put(s,buf,len)
56
register substdio *s;
56
register substdio *s;
57
register char *buf;
57
register char *buf;
58
register int len;
58
register unsigned int len;
59
{
59
{
60
  register int n;
60
  register unsigned int n = s->n; /* how many bytes to write in next chunk */
61
 
61
 
62
  n = s->n;
62
  /* check if the input would fit in the buffer without flushing */
63
  if (len > n - s->p) {
63
  if (len > n - (unsigned int)s->p) {
64
    if (substdio_flush(s) == -1) return -1;
64
    if (substdio_flush(s) == -1) return -1;
65
    /* now s->p == 0 */
65
    /* now s->p == 0 */
66
    if (n < SUBSTDIO_OUTSIZE) n = SUBSTDIO_OUTSIZE;
66
    if (n < SUBSTDIO_OUTSIZE) n = SUBSTDIO_OUTSIZE;
67
    while (len > s->n) {
67
    /* as long as the remainder would not fit into s->x write it directly
68
     * from buf to s->fd. */
69
    while (len > (unsigned int)s->n) {
68
      if (n > len) n = len;
70
      if (n > len) n = len;
69
      if (allwrite(s->op,s->fd,buf,n) == -1) return -1;
71
      if (allwrite(s->op,s->fd,buf,n) == -1) return -1;
70
      buf += n;
72
      buf += n;
71
- 

Return to bug 721566