On Sat, May 12, 2001 at 05:05:44PM +0300, Valentin Nechayev wrote:
> Hello Daniel Hemmerich! 
[snip]
> 
> Here strnlen() is used which is non-standard but I saw it in ~4 quite
> different projects (e.g. Linux kernel) with identical interface
> and result value; a variant of implementation follows:
> 
> /* This is candidate to have optimized assembler variant */
> size_t strnlen( const char* src, size_t max )
> {
>       size_t n;
>       while( n < max && *src != '\0' )
>               n++;
>       return n;
> }

I really hope you meant *src++ there :)

G'luck,
Peter

-- 
If there were no counterfactuals, this sentence would not have been paradoxical.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to