Re: [PATCH 01/10] cifs: add function to get length of NULL termination in bytes

Christoph Hellwig <[email protected]>
Newsgroups gmane.linux.file-systems.cifs
Message-ID <[email protected]>
On Wed, Apr 29, 2009 at 09:29:11AM -0400, Jeff Layton wrote:
>  /*
> + * null_charlen - return length of null character for codepage
> + * @codepage - codepage for which to return length of NULL terminator
> + *
> + * Since we can't guarantee that the null terminator will be a particular
> + * length, we have to check against the codepage. If there's a problem
> + * determining it, assume a single-byte NULL terminator.
> + */
> +static inline int
> +null_charlen(const struct nls_table *codepage)
> +{
> +	int charlen;
> +	char tmp[NLS_MAX_CHARSET_SIZE];
> +
> +	charlen = codepage->uni2char(0, tmp, NLS_MAX_CHARSET_SIZE);
> +
> +	return charlen > 0 ? charlen : 1;
> +}

Add this to include/linux/nls.h instead?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.