Messages in this thread | | | Date | Tue, 12 Aug 2003 16:54:05 +0100 (BST) | From | William Gallafent <> | Subject | Re: generic strncpy - off-by-one error |
| |
On Tue, 12 Aug 2003 Valdis.Kletnieks@vt.edu wrote:
> 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?
Er, consider the case of count == 1. Fenceposts can be dangerous things.
-- Bill Gallafent. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |