Commit
165efde7 changed a_resolve to not require a port number.
Unfortunately, I botched it and wrote a test for av[i + 1] as
av[i + i]. Result with i = 0: very different.
While investigating this bug, I became nervous about the number of
is-av[i]-null tests going on when str_qsplit doesn't actually guarantee
to leave a null terminator behind if it uses all the array slots. So
I've allocated an extra slot and zeroed it explicitly.
r->sa.sin.sin_family = AF_INET;
r->sasz = sizeof(r->sa.sin);
r->addr = xstrdup(av[i]);
r->sa.sin.sin_family = AF_INET;
r->sasz = sizeof(r->sa.sin);
r->addr = xstrdup(av[i]);
pt = TRIPE_PORT;
else {
pt = strtoul(av[i + 1], &p, 0);
pt = TRIPE_PORT;
else {
pt = strtoul(av[i + 1], &p, 0);
{
admin *a = vp;
const acmd *c;
{
admin *a = vp;
const acmd *c;
- ac = str_qsplit(p, av, 16, 0, STRF_QUOTE);
+ ac = str_qsplit(p, av, N(av) - 1, 0, STRF_QUOTE);
for (c = acmdtab; c->name; c++) {
if (mystrieq(av[0], c->name)) {
ac--;
for (c = acmdtab; c->name; c++) {
if (mystrieq(av[0], c->name)) {
ac--;