bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Expr: Improvement of substr


From: Paul Eggert
Subject: Re: Expr: Improvement of substr
Date: Mon, 11 Sep 2006 12:26:00 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

"Sebastian Kreft" <address@hidden> writes:

> Besides the use of int instead of size_t, what is the problem of portability
> with my patch?

Nothing.  That was the problem I was referrring to.  For example, the
patch you proposed mishandles a string of length 2147483648 on hosts
with 32-bit int, because 'length' wraps around to -2147483648.

> And finally, why do you use mempcpy instead of strncpy?

A minor speed increase.  mempcpy need not check for '\0'.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]