On Thu, 28 Jan 1999, Jonathan A. Zdziarski wrote: > OK NOW: Let me introduce a new question to you. How come we cannot > write our std c libraries to do something similar to this before > performing strcat's, etc... > > a[sizeof(b)] = NULL (or 0); > > to nullify out position x of the variable being copied from where b is the > variable being copied to ... so if b is a 128 byte array, a[128] = > 0...if there's a null before that fine...it will stop there...if not, it > will forcibly stop at 128 when it hits the null. If a is *not* at least 128 bytes you've just overstepped your bounds. Besides, when you have received b as a character pointer sizeof() will return the size of the pointer, not the size of the character array. Paul Braman aeonat_private
This archive was generated by hypermail 2b30 : Fri Apr 13 2001 - 14:31:59 PDT