home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / next / programm / 5220 < prev    next >
Encoding:
Internet Message Format  |  1992-07-24  |  1.3 KB

  1. Path: sparky!uunet!van-bc!questor!hfs!bhead
  2. From: bhead@hfs.questor.wimsey.bc.ca (Bradley Head)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: strlen() memory exception in Speaker/Listener - NeXT's doing
  5. Message-ID: <1992Jul24.150603.8020@hfs.questor.wimsey.bc.ca>
  6. Date: Fri, 24 Jul 1992 15:06:03 GMT
  7. Sender: bhead@hfs.questor.wimsey.bc.ca (Bradley Head)
  8. Reply-To: bhead@hfs.questor.wimsey.bc.ca (Bradley Head)
  9. Organization: Headfirst Software, Vancouver, BC, Canada
  10. Lines: 18
  11.  
  12.  
  13.  
  14. When I specify a parameter type of (char *) in  a msgwrap file, then 
  15. proceed to use the speaker message passing a NULL pointer, the speaker 
  16. sending mechanism produces an exception inside strlen(). Why didn't NeXT  
  17. check for NULL prior to calling strlen(). Now I have to, and it makes the 
  18. interface less than seamless. In University, when writing published
  19. functions, I was taught to check input parameters (especially pointers) 
  20. prior to using them.  strlen() doesn't check for a NULL string pointer  
  21. before dereferencing it (which is why I wrote my own strlen()), neither  
  22. does NeXT before using it inside Speaker/Listener. Now I have to throw in 
  23. the check prior to the call. This wouldn't bother me so much if NeXT would 
  24. DOCUMENT such a side affect.
  25.  
  26. ...Brad
  27. -- 
  28. Bradley Head, bhead@hfs.questor.wimsey.bc.ca (NeXTmail :-)
  29. InStep Mobile Communications Inc., Vancouver, BC CANADA
  30.