Take from heirloom's doctools version of checknr(1) some cosmetic fixes

This helps working on synchronising both tools
This commit is contained in:
bapt 2015-05-04 22:05:12 +00:00
parent fe846feb04
commit 7169caff2e

View File

@ -395,7 +395,8 @@ prop(int i)
break;
default:
printf("Bug: stk[%d].opno = %d = .%s, .%s",
i, stk[i].opno, br[stk[i].opno].opbr, br[stk[i].opno].clbr);
i, stk[i].opno, br[stk[i].opno].opbr,
br[stk[i].opno].clbr);
}
}
@ -567,7 +568,9 @@ printf("binsrch(%s) -> %d\n", mac, slot);
*loc = strcpy(malloc(3), mac);
ncmds++;
#ifdef DEBUG
printf("after: %s %s %s %s %s, %d cmds\n", knowncmds[slot-2], knowncmds[slot-1], knowncmds[slot], knowncmds[slot+1], knowncmds[slot+2], ncmds);
printf("after: %s %s %s %s %s, %d cmds\n",
knowncmds[slot-2], knowncmds[slot-1], knowncmds[slot],
knowncmds[slot+1], knowncmds[slot+2], ncmds);
#endif
}
@ -592,12 +595,12 @@ binsrch(const char *mac)
if (d == 0)
d = p[1] - mac[1];
if (d == 0)
return mid;
return (mid);
if (d < 0)
bot = mid + 1;
else
top = mid - 1;
}
slot = bot; /* place it would have gone */
return -1;
return (-1);
}