]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Remove the no more used nd_printzp() function
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 10 Dec 2020 21:49:21 +0000 (22:49 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Thu, 10 Dec 2020 21:52:57 +0000 (22:52 +0100)
The function to use now is: nd_printjnp().
(Added by comit 635e3cc92b72ca048a6b5b89b883980e4e1b4bdc)

netdissect.h
util-print.c

index e50c319a9b73b231d79f778c49c089897233859b..8595287e09600d297a7b5a0b0d9f1d728ffd8238 100644 (file)
@@ -394,7 +394,6 @@ extern void fn_print_str(netdissect_options *, const u_char *);
 extern int nd_print(netdissect_options *, const u_char *, const u_char *);
 extern u_int nd_printztn(netdissect_options *, const u_char *, u_int, const u_char *);
 extern int nd_printn(netdissect_options *, const u_char *, u_int, const u_char *);
-extern int nd_printzp(netdissect_options *, const u_char *, u_int, const u_char *);
 extern void nd_printjnp(netdissect_options *, const u_char *, u_int);
 
 /*
index 3d3caa5aa79ed0f47fd68f08d40594d051fe342f..f9ea618d1a4dce8823d01e31ab3862985c3f0656 100644 (file)
@@ -198,36 +198,6 @@ nd_printn(netdissect_options *ndo,
        return (n == 0) ? 0 : 1;
 }
 
-/*
- * Print out a null-padded filename (or other ASCII string), part of
- * the packet buffer.
- * If ep is NULL, assume no truncation check is needed.
- * Return true if truncated.
- * Stop at ep (if given) or after n bytes or before the null char,
- * whichever is first.
- */
-int
-nd_printzp(netdissect_options *ndo,
-           const u_char *s, u_int n,
-           const u_char *ep)
-{
-       int ret;
-       u_char c;
-
-       ret = 1;                        /* assume truncated */
-       while (n > 0 && (ep == NULL || s < ep)) {
-               n--;
-               c = GET_U_1(s);
-               s++;
-               if (c == '\0') {
-                       ret = 0;
-                       break;
-               }
-               fn_print_char(ndo, c);
-       }
-       return (n == 0) ? 0 : ret;
-}
-
 /*
  * Print a null-padded filename (or other ASCII string), part of
  * the packet buffer, filtering out non-printable characters.