TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: SIMON AVERY
from: GEORGE WHITE
date: 1998-04-13 21:39:00
subject: Curioser and curioser...

Hi Simon,
You asked:

SA>printf("Ping! [%s][%d]\n",ptr2,writelevel);
SA>}
SA>At the first "Ping!" writelevel is true;= 10.
SA>At the second, it returns 26723
SA>This ONLY occurs if "writelevel" is declared globally. If I declare it
SA>local to the function then it works properly. It does the same with the
SA>other three atoi() ints I read in, and yes, I have checked that I've not
SA>re-used "writelevel" elsewhere. It shouldn't change!
SA>Why is this?
In my personal experience this is a symptom of either buffer over-run
(I've certainly caused it by this myself) or an improperly initialised
pointer.
SA>(TCC3 16-bit dos under Win95. Small mem model, trivial program in
SA>early stages and no memory holes that I can see.)
The code as posted doesn't show any memory allocations for the pointers.
If the code is small enough and you're prepared to let me see it,
send all of it my way and I'll look it over.
George
 * SLMR 2.1a * Wastebasket: Something to throw things near.
--- Maximus/2 3.01
---------------
* Origin: DoNoR/2,Woking UK (44-1483-717905) (2:440/4)

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™.