Eric Blake <ebl...@redhat.com> writes: > + ASSERT (STREQ (buf, "hello my world")); > + ASSERT (len = strlen (buf));
These two tests, plus some others, assume that open_memstream allocates a buffer in which the output is NUL-terminated. This isn't a portable assumption (though it is often true, which I expect is why the tests passed in your case).