Path: utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!sgi!jmb From: jmb@patton.SGI.COM (Jim Barton) Newsgroups: comp.unix.microport Subject: Re: Pcomm Message-ID: <15105@sgi.SGI.COM> Date: 24 May 88 00:41:00 GMT References: <387@dalek.UUCP> Sender: daemon@sgi.SGI.COM Organization: Silicon Graphics Inc, Mountain View, CA Lines: 22 I've gotten pcomm to work allright, but had to fix a series of glaring errors. They all have to do with the author passing NULL for null string arguments in many places. THIS IS NOT PORTABLE CODE. Aside from the fact that NULL is 2 bytes (on the 286) versus 4 bytes for a character pointer, it also forces you to de-reference 0 (hence the memory fault). Some primitive architectures (such as the VAX) allow you to de-reference 0 and get 0 back - most modern systems disallow this. Check out calls to 'str_prompt', 'menu_prompt', and the call to 'init' out of main as a first pass at fixing things up. Oh, I just remembered. In a few places (notably s_tty, I think) he sets up a menu array and initializes the last element to NULL to end the list, but of course the code reads something like: if (*menu[i] == NULL) ... -- Jim Barton Silicon Graphics Computing Systems "UNIX: Live Free Or Die!" jmb@sgi.sgi.com, sgi!jmb@decwrl.dec.com, ...{decwrl,sun}!sgi!jmb --