Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Thu, 26 Apr 2018 12:46:31 +0200
From: Szabolcs Nagy <>
Subject: getopt_long_only bug

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
$ ./a.glibc

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.