Re: generic strncpy - off-by-one error

Andreas Schwab
2003-08-12T16:09:41Z

[-- Attachment #1: Type: text/plain, Size: 605 bytes --]

Valdis.Kletnieks@vt.edu writes:

|> On Tue, 12 Aug 2003 23:50:06 +0900, Yoshinori Sato <ysato@users.sourceforge.jp> said:
|>
|> > - while (count) {
|> > + while (count > 1) {
|>
|> Given that count is a size_t, which seems to be derived from 'unsigned int' or
|> 'unsigned long' on every platform, how are these any different?

Let's suppose count == 1.

Andreas.

--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]