case 'P':
{
int l = atoi(fmt + 1);
- ND_TCHECK2(buf[0], l);
+ ND_TCHECK_LEN(buf, l);
buf += l;
fmt++;
while (isdigit((unsigned char)*fmt))
case 's':
{
int l = atoi(fmt + 1);
- ND_TCHECK2(*buf, l);
+ ND_TCHECK_LEN(buf, l);
ND_PRINT((ndo, "%-*.*s", l, l, buf));
buf += l;
fmt++;
}
case 'c':
{
- ND_TCHECK2(*buf, stringlen);
+ ND_TCHECK_LEN(buf, stringlen);
ND_PRINT((ndo, "%-*.*s", (int)stringlen, (int)stringlen, buf));
buf += stringlen;
fmt++;
case 'h':
{
int l = atoi(fmt + 1);
- ND_TCHECK2(*buf, l);
+ ND_TCHECK_LEN(buf, l);
while (l--) {
ND_PRINT((ndo, "%02x", EXTRACT_U_1(buf)));
buf++;