🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #222

strlen() memory exception in Speaker/Listener - NeXT's doing

#222
From: Bradley Head
Date: Fri, 24 Jul 1992 15:06
18 lines
1396 bytes

When I specify a parameter type of (char *) in  a msgwrap file, then 
proceed to use the speaker message passing a NULL pointer, the speaker 
sending mechanism produces an exception inside strlen(). Why didn't NeXT  
check for NULL prior to calling strlen(). Now I have to, and it makes the 
interface less than seamless. In University, when writing published
functions, I was taught to check input parameters (especially pointers) 
prior to using them.  strlen() doesn't check for a NULL string pointer  
before dereferencing it (which is why I wrote my own strlen()), neither  
does NeXT before using it inside Speaker/Listener. Now I have to throw in 
the check prior to the call. This wouldn't bother me so much if NeXT would 
DOCUMENT such a side affect.

...Brad
-- 
Bradley Head, bhead@hfs.questor.wimsey.bc.ca (NeXTmail :-)
InStep Mobile Communications Inc., Vancouver, BC CANADA
Technical Details
Message-ID: <1992Jul24.150603.8020@hfs.questor.wimsey.bc.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!van-bc!questor!hfs!bhead

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!van-bc!questor!hfs!bhead
From: bhead@hfs.questor.wimsey.bc.ca (Bradley Head)
Newsgroups: comp.sys.next.programmer
Subject: strlen() memory exception in Speaker/Listener - NeXT's doing
Message-ID: <1992Jul24.150603.8020@hfs.questor.wimsey.bc.ca>
Date: Fri, 24 Jul 1992 15:06:03 GMT
Sender: bhead@hfs.questor.wimsey.bc.ca (Bradley Head)
Reply-To: bhead@hfs.questor.wimsey.bc.ca (Bradley Head)
Organization: Headfirst Software, Vancouver, BC, Canada
Lines: 18