/* Print out a null-terminated 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 before the null char, whichever is first.  */
int fn_print(netdissect_options *ndo, register const u_char *s, register const u_char *ep)
/* Print out a null-terminated 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 before the null char, whichever is first.  */
int fn_print(netdissect_options *ndo, register const u_char *s, register const u_char *ep)
{
	register int ret;
	register u_char c;
	ret = 1;
	while (ep == NULL || s < ep) {
		c = *s++;
		if (c == '\0') {
			ret = 0;
			break;
		}
		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(ret);
}