1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-13 07:03:25 +00:00

Help shows option groups beyond 32 bits

This commit is contained in:
Gerhard 2025-02-20 10:26:37 +01:00
parent b57d8668ec
commit 6a53c955d3
2 changed files with 8 additions and 2 deletions

View file

@ -87,6 +87,8 @@ static int xiohelp_option(FILE *of, const struct optname *on, const char *name)
groups = on->desc->group;
occurred = false;
chars = 7;
if (groups == 0)
fputs("(all)", of);
for (j = 0; j < 8*sizeof(groups_t); ++j) {
if (groups & 1) {
if (occurred) {
@ -150,8 +152,9 @@ int xioopenhelp(FILE *of,
i = (40 - chars + 7) / 8;
for (; i > 0; --i) { fputc('\t', of); }
fputs("\tgroups=", of);
groups = an->desc->groups; occurred = false;
for (j = 0; j < 32; ++j) {
groups = an->desc->groups;
occurred = false;
for (j = 0; j < sizeof(groups_t)*8; ++j) {
if (groups & 1) {
if (occurred) { fputc(',', of); }
fprintf(of, "%s", addressgroupnames[j]);