Skip to content

Commit 7c24b52

Browse files
fxlbguyharris
authored andcommitted
SMB: Avoid reinventing nd_printjn()
1 parent 2d2951a commit 7c24b52

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

smbutil.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -257,15 +257,6 @@ name_len(netdissect_options *ndo,
257257
return(-1); /* name goes past the end of the buffer */
258258
}
259259

260-
static void
261-
print_asc(netdissect_options *ndo,
262-
const u_char *buf, u_int len)
263-
{
264-
u_int i;
265-
for (i = 0; i < len; i++)
266-
fn_print_char(ndo, GET_U_1(buf + i));
267-
}
268-
269260
static const char *
270261
name_type_str(int name_type)
271262
{
@@ -297,9 +288,9 @@ smb_data_print(netdissect_options *ndo, const u_char *buf, u_int len)
297288
if (i%8 == 0)
298289
ND_PRINT(" ");
299290
if (i % 16 == 0) {
300-
print_asc(ndo, buf + i - 16, 8);
291+
nd_printjn(ndo, buf + i - 16, 8);
301292
ND_PRINT(" ");
302-
print_asc(ndo, buf + i - 8, 8);
293+
nd_printjn(ndo, buf + i - 8, 8);
303294
ND_PRINT("\n");
304295
if (i < len)
305296
ND_PRINT("[%03X] ", i);
@@ -316,11 +307,11 @@ smb_data_print(netdissect_options *ndo, const u_char *buf, u_int len)
316307
ND_PRINT(" ");
317308

318309
n = ND_MIN(8, i % 16);
319-
print_asc(ndo, buf + i - (i % 16), n);
310+
nd_printjn(ndo, buf + i - (i % 16), n);
320311
ND_PRINT(" ");
321312
n = (i % 16) - n;
322313
if (n > 0)
323-
print_asc(ndo, buf + i - n, n);
314+
nd_printjn(ndo, buf + i - n, n);
324315
ND_PRINT("\n");
325316
}
326317
}

0 commit comments

Comments
 (0)