Commit 0c76b2b1 0c76b2b1a4325a8e96292161ee95523ecb6cbc14 by Sergey Poznyakoff

Fix default nullstream read mode

* libmailutils/stream/nullstream.c (_nullstream_free_pattern): Always
reset pattern and patsize.
(mu_nullstream_create): Fix patsize.
1 parent 00c27bc2
......@@ -66,10 +66,10 @@ _nullstream_free_pattern (struct _mu_nullstream *np)
if (!(np->mode & MU_NULLSTREAM_PATSTAT))
{
free (np->pattern);
np->pattern = NULL;
np->patsize = 0;
np->mode &= ~MU_NULLSTREAM_PATSTAT;
}
np->pattern = NULL;
np->patsize = 0;
}
static void
......@@ -196,8 +196,8 @@ mu_nullstream_create (mu_stream_t *pref, int flags)
np->base.truncate = _nullstream_truncate;
np->base.done = _nullstream_done;
np->pattern = "";
np->patsize = 0;
np->pattern = "\0";
np->patsize = 1;
np->mode = MU_NULLSTREAM_PATSTAT;
*pref = (mu_stream_t) np;
......