[5848] in Athena Bugs
decmips 7.1H: null deref's in penplot library
daemon@ATHENA.MIT.EDU (Ezra Peisach)
Fri Aug 24 19:31:43 1990
To: bugs@ATHENA.MIT.EDU
Date: Fri, 24 Aug 90 19:31:27 EDT
From: Ezra Peisach <epeisach@ATHENA.MIT.EDU>
System name: BOOM
Type and version: KN01 7.1H (1 update(s) to same version)
Display type: PM-MONO
What were you trying to do?
Compile the penplot library on the DS3100
(It is not installed on the DS3100, and probably will not be,
but knowing how to compile it is important)
What's wrong:
Trying to use it causes it to die early on
What should have happened:
Should be able to use the library
Please describe any relevant documentation references:
RCS file: RCS/vs100.c,v
retrieving revision 1.1
diff -c -r1.1 vs100.c
*** /tmp/,RCSt1a18440 Fri Aug 24 19:29:12 1990
--- vs100.c Fri Aug 24 18:42:20 1990
***************
*** 133,139 ****
int init_y_pos;
char display[40];
! char *getenv(), *cp;
Pixmap border;
Cursor cursor;
--- 133,139 ----
int init_y_pos;
char display[40];
! char *getenv(), *cp, *ge;
Pixmap border;
Cursor cursor;
***************
*** 165,171 ****
/* Get the host:vsnum tuple from the special PENPLOT_DISPLAY */
/* environment variable, if possible */
! strncat(display,getenv("PENPLOT_DISPLAY"),sizeof(display));
if( !(dpyp = XOpenDisplay(display)) ){
fprintf (stderr,
"%s in %s: Unable to open display.\n",
--- 165,172 ----
/* Get the host:vsnum tuple from the special PENPLOT_DISPLAY */
/* environment variable, if possible */
! if((ge = getenv("PENPLOT_DISPLAY")))
! strncat(display,ge,sizeof(display));
if( !(dpyp = XOpenDisplay(display)) ){
fprintf (stderr,
"%s in %s: Unable to open display.\n",
***************
*** 187,193 ****
/* forground. */
cp = getenv("PENPLOT_BACKGROUND");
! if ((strncmp(cp, "BLACK", 5) == 0) || (strncmp(cp, "black", 5) == 0)) {
foreground = WhitePixel(dpyp,plotscreen);
background = BlackPixel(dpyp,plotscreen);
--- 188,194 ----
/* forground. */
cp = getenv("PENPLOT_BACKGROUND");
! if (cp && ((strncmp(cp, "BLACK", 5) == 0) || (strncmp(cp, "black", 5) == 0))) {
foreground = WhitePixel(dpyp,plotscreen);
background = BlackPixel(dpyp,plotscreen);