Pcomm
Jim Barton
jmb at patton.SGI.COM
Tue May 24 10:41:00 AEST 1988
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 at sgi.sgi.com, sgi!jmb at decwrl.dec.com, ...{decwrl,sun}!sgi!jmb
--
More information about the Comp.unix.microport
mailing list