mailing list of musl libc
 help / color / mirror / code / Atom feed
* getopt_long_only bug
@ 2018-04-26 10:46 Szabolcs Nagy
  2018-04-26 14:50 ` Rich Felker
  0 siblings, 1 reply; 3+ messages in thread
From: Szabolcs Nagy @ 2018-04-26 10:46 UTC (permalink / raw)
  To: musl

i got the following bug report:

$ cat a.c
#include <stdio.h>
#include <getopt.h>

int main()
{
	struct option lo[] =
	{
		{"emit-relocs", no_argument, NULL, 'q'},
		{"qmagic", no_argument, NULL, 'Q'},
		{ 0 }
	};

	int li = -1;
	char* a[] = { "", "-q", NULL };
	int c = getopt_long_only(2, a, "q", lo, &li);

	printf("c=%c/%i\n", c, c);

	return 0;
}
$ ./a.musl
c=Q/81
$ ./a.glibc
c=q/113


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-26 20:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-26 10:46 getopt_long_only bug Szabolcs Nagy
2018-04-26 14:50 ` Rich Felker
2018-04-26 20:17   ` Szabolcs Nagy

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).