/* Print out a counted filename (or other ascii string). If ep is NULL, assume no truncation check is needed. Return true if truncated. Stop at ep (if given) or after n bytes, whichever is first.  */
int fn_printn(netdissect_options *ndo, register const u_char *s, register u_int n, register const u_char *ep)
/* Print out a counted filename (or other ascii string). If ep is NULL, assume no truncation check is needed. Return true if truncated. Stop at ep (if given) or after n bytes, whichever is first.  */
int fn_printn(netdissect_options *ndo, register const u_char *s, register u_int n, register const u_char *ep)
{
	register u_char c;
	while (n > 0 && (ep == NULL || s < ep)) {
		n--;
		c = *s++;
		if (!ND_ISASCII(c)) {
			c = ND_TOASCII(c);
			ND_PRINT((ndo, "M-"));
		}
		if (!ND_ISPRINT(c)) {
			c ^= 0x40;
			ND_PRINT((ndo, "^"));
		}
		ND_PRINT((ndo, "%c", c));
	}
	return (n == 0) ? 0 : 1;
}