* or later
*/
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "netdissect-stdinc.h"
s += GET_U_1(s) + 1;
ND_TCHECK_1(s);
}
- return(ND_BYTES_BETWEEN(s, s0) + 1);
+ return(ND_BYTES_BETWEEN(s0, s) + 1);
trunc:
return(-1); /* name goes past the end of the buffer */
u_int i = 0;
while ((p = strchr(fmt, '|'))) {
- u_int l = ND_BYTES_BETWEEN(p, fmt);
+ u_int l = ND_BYTES_BETWEEN(fmt, p);
if (l && (val & (1 << i)))
ND_PRINT("%.*s ", (int)l, fmt);
fmt = p + 1;
u_int l;
p = strchr(++fmt, '}');
- l = ND_BYTES_BETWEEN(p, fmt);
+ l = ND_BYTES_BETWEEN(fmt, p);
if (l > sizeof(bitfmt) - 1)
l = sizeof(bitfmt)-1;
switch (t) {
case 1:
- name_type = name_extract(ndo, startbuf, ND_BYTES_BETWEEN(buf, startbuf),
- maxbuf, nbuf);
+ name_type = name_extract(ndo, startbuf,
+ ND_BYTES_BETWEEN(startbuf, buf),
+ maxbuf, nbuf);
if (name_type < 0)
goto trunc;
len = name_len(ndo, buf, maxbuf);
break;
}
if (t != 0) {
- tstring = nd_format_time(buffer, sizeof(buffer), "%a %b %e %T %Y",
- localtime(&t));
+ tstring = nd_format_time(buffer, sizeof(buffer), "%Y-%m-%d %T",
+ localtime(&t));
} else
tstring = "NULL";
ND_PRINT("%s\n", tstring);
}
}
if (!depth && buf < maxbuf) {
- u_int len = ND_BYTES_BETWEEN(maxbuf, buf);
+ u_int len = ND_BYTES_BETWEEN(buf, maxbuf);
ND_PRINT("Data: (%u bytes)\n", len);
smb_data_print(ndo, buf, len);
return(buf + len);