TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: BILL BIRRELL
from: DARIN MCBRIDE
date: 1998-03-09 09:30:00
subject: Avoid disaster

 >
 >      char string[4];
 >      string="OUCH";
 BB>     This itself is a disaster waiting to happen. Not 
 BB> only has it created both an instant type qualifier 
 BB> conflict and an array which is one element too small, 
 BB> but it has also attempted to change the fixed address 
 BB> of the array by assigning to it the address of a string 
 BB> constant. Whoever did this does not understand what he 
 BB> is doing.
I'm not sure if you read the rest of John's message or not, but he was 
looking for ways to PREVENT this type of thing from happening, although his 
example was poor in that this is an example of something that cannot happen 
(due to an attempt to assign to string rather than using strcpy).
He wanted some automated way to determine if he was about to overwrite an 
array boundary.  Unfortunately, in C, there is no such beast.
---
---------------
* Origin: Tanktalus' Tower BBS (1:250/102)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.