On Wed, 2020-06-24 at 12:44 -0700, Sean V Kelley wrote: > That works well, I can also add the hyphen if it is adjacent with > this, > I think: > > for (int dev=0; dev < 32; dev++) > { > if (BITS(bmap, dev, 1)) > { > if (!adjcount) > printf("%s %u", (prevmatched) ? "," : "", dev); > prevmatched=1; > adjcount++; > prevdev=dev; > } > else > { > if (adjcount > 1) > printf("-%u", prevdev); > adjacent=0; Rather, I meant: adjcount=0; > } > } > >