[comp.bugs.misc] Slight bug in dvi2tty

rouilj@umb.umb.edu (John P. Rouillard) (12/30/88)

Program: dvi2tty (posted comp.sources.misc)

Description: When running dvi2tty segmentation violation occurs if
	     environment variable DVI2TTY is not defined.

Cause: In dvi2tty.c a test for a null pointer being returned from
       getenv("DVI2TTY") is missing. The offending line of code is at
       line 266 in dvi2tty.c.  

Fix: The fix is to put a test for envp being NULL before it is
     dereferenced.

Comment: This appears to be the only mistake in an otherwise useful
	 tool.

==========================================================================
  Person                U.S. Snail Addr        		E-Mail Addr
John Rouillard	       Physics Department   	     harvard!umb!rouilj
U-Mass Boston	       U-Mass Boston	    	     husc6!umb!rouilj
Physics Major	       Harbor Campus	    	     rouilj@umb.umb.edu
		       Boston, MA 02125
 		

cww@ndmath.UUCP (Clarence W. Wilkerson) (12/31/88)

While trying to compile this under turbo c, it pointed out
a couple of '=' that should be '==' in the test for file
extension 'dvi'. That was in both dvi2tty and disdvi.
I got disdvi to run fine, but not dvi2tty. There was also
a "ifdef 0" that was complained about, and a couple of places
where compile time constants led to dead code.