Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Are bad developer libraries the problem with M$ software?

From: Frank Knobbe <fknobbe(at)knobbeits.com>
Date: Mon Nov 18 2002 - 22:25:46 EST

On Mon, 2002-11-18 at 17:10, Andrew Griffiths wrote:

> Another thing to use is consistency, for example,

If sizeof(dst) is 50, then a 0 terminated string is is 49 chars long (len(dst) is 49). That means we've got 50-49-1 = 0 which is correct as there is no room left in dst.

Of course in your example you allow dst to overflow in the strncpy. Using
  strncpy(dst, user_supplied_data, sizeof(dst)-1); would have prevented that if my math is correct.

Frank

Received on Tue Nov 19 14:29:16 2002
Do you need help?X

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:02:44 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library