The action callback returned zero, with a 1999 comment asking if it was
checked. traverse() didn't check it. Change it so it does, wanting
`OK' if all's well, else returning the non-OK value to traverse's
caller; though that only checks for NOTOK. No functional change
intended.
NMH_UNUSED(closure);
fprintf (pf, "%s\n", s);
stop += strlen (s) + 1;
NMH_UNUSED(closure);
fprintf (pf, "%s\n", s);
stop += strlen (s) + 1;
- return 0; /* Is return value used? This was missing before 1999-07-15. */
if ((snoopstate = netsec_get_snoop(nsc)))
netsec_set_snoop(nsc, 0);
if ((snoopstate = netsec_get_snoop(nsc)))
netsec_set_snoop(nsc, 0);
- for (;;)
- switch (multiline ()) {
- case NOTOK:
- netsec_set_snoop(nsc, snoopstate);
- return NOTOK;
-
- case DONE:
- strncpy (response, buffer, sizeof(response));
- netsec_set_snoop(nsc, snoopstate);
- return OK;
+ for (;;) {
+ result = multiline();
+ if (result == OK) {
+ result = (*action)(closure, response);
+ if (result == OK)
+ continue;
+ } else if (result == DONE) {
+ strncpy(response, buffer, sizeof(response));
+ result = OK;
+ }
+ break;
+ }
- case OK:
- (*action)(closure, response);
- break;
- }
+ netsec_set_snoop(nsc, snoopstate);
+ return result;