c = EXTRACT_U_1(s);
if ((c & 0xC0) == 0xC0)
return(2);
- while (*s) {
+ while (EXTRACT_U_1(s)) {
if (s >= maxbuf)
return(-1); /* name goes past the end of the buffer */
ND_TCHECK_1(s);
- s += (*s) + 1;
+ s += EXTRACT_U_1(s) + 1;
ND_TCHECK_1(s);
}
return(PTR_DIFF(s, s0) + 1);
{
u_int i;
for (i = 0; i < len; i++)
- safeputchar(ndo, EXTRACT_U_1(buf + i));
+ fn_print_char(ndo, EXTRACT_U_1(buf + i));
}
static const char *
}
void
-smb_print_data(netdissect_options *ndo, const u_char *buf, u_int len)
+smb_data_print(netdissect_options *ndo, const u_char *buf, u_int len)
{
u_int i = 0;
return;
trunc:
- ND_PRINT("\n");
- ND_PRINT("WARNING: Short packet. Try increasing the snap length\n");
+ nd_print_trunc(ndo);
}
return(buf);
trunc:
- ND_PRINT("\n");
- ND_PRINT("WARNING: Short packet. Try increasing the snap length\n");
+ nd_print_trunc(ndo);
return(NULL);
}
if (!depth && buf < maxbuf) {
size_t len = PTR_DIFF(maxbuf, buf);
ND_PRINT("Data: (%lu bytes)\n", (unsigned long)len);
- smb_print_data(ndo, buf, len);
+ smb_data_print(ndo, buf, len);
return(buf + len);
}
return(buf);
/*
* return a SMB error string from a SMB buffer
*/
-char *
+const char *
smb_errstr(int class, int num)
{
static char ret[128];