This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2][BZ #13152] fmemopen does not honor append mode.


> New version. I added append flag and refactored fmemopen a bit.

ChangeLog entry missing.

The refactoring makes it a little harder to review.  Perhaps first post a
pure refactoring change that doesn't affect the behavior at all.  Once
we've reviewed that and it's been committed, it will be much easier to
review the functional change.

> +/* Test for binary mode see bug 13152.

Run-on sentence: add a ; before "see".

And rename the file something like "test-fmemopen-append.c".

> +int
> +do_test (int argc, char **argv)

The norm for a test that doesn't use the arguments is:

	static int
	do_test (void)
	{
	  ...
	}

	#define TEST_FUNCTION	do_test ()
	#include "../test-skeleton.c"

> +  char expected[20] = "hello, worldX";

Make this:

	static const char expected[] = "hello, worldX";

> +  FILE *fp = fmemopen(buf, 20, "a+");

Space before paren, here and throughout.

> +  for (int i = 0; i < strlen (expected); i++)

Use size_t.  Use "sizeof expected - 1".


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]