TIP: Click on subject to list as thread! ANSI
echo: os2
to: WILL HONEA
from: MIKE RUSKAI
date: 1999-11-17 19:29:00
subject: Missing Window control..

Some senseless babbling from Will Honea to Mike Ruskai
on 11-16-99  23:48 about Missing Window control.....

 WH> MIKE RUSKAI wrote to WILL HONEA on 11-16-1999
 
 MR> Cripes.  I guess that means they just did an equality comparison
 MR> with FILE_DIRECTORY, rather than a bitwise AND, or using a bit field
 MR> (my preference), etc.
 MR> 
 MR> Pretty stupid.

 WH> I traced the Post Road code and that's exactly what they did.  I've
 WH> got several years worth of this kind of crap collected in one of my
 WH> YGBSM files - amazing what 'professional' programmers will do at
 WH> times.
 WH> My favorite was a set of utilities by a well known and respected
 WH> software house.  In C code, they were returning a pointer to an
 WH> automatic variable which pointed to a memory location on the stack.

 WH> char *routine(struct TIME *local_time)
 WH> {
 WH> char day_of_week[9];
 WH> ( some code )
 WH> return day_of_week;
 WH> }

 WH> When we reported it as a bug, their reply was:

 WH> 'This routine is designed to be used only as a calling argument so the
 WH> stack is not modified before the value is copied. for example: 
 WH> printf(file,"%s", routine( local_time)).'

 WH> There were at least 30 of these little goodies in their commercial
 WH> library and they absolutely refused to correct it - all the while
 WH> admitting that the return pointed to out-of-scope non-allocated
 WH> memory!
 WH> So much for that vendor!

Did it work at all?  I can see where it might, as a fluke, with nothing
overwriting the address in question.

All it'd take to get rid of the bug is to add a "static", too.  They didn't
even want to make that effort?

Mike Ruskai
thannymeister@yahoo.com


... I am not an idiot, but I play one on FidoNet!

___ Blue Wave/QWK v2.20
--- Platinum Xpress/Win/Wildcat5! v3.0pr2
143/1
* Origin: FIDO QWK MAIL & MORE! WWW.DOCSPLACE.ORG (1:3603/140)

SOURCE: echoes via The OS/2 BBS

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