[net.news.b] small bug in visual.c

chris@pixutl.UUCP (chris) (07/02/84)

   Vnews is supposed to warn you if you have mail when you start up
and if you get new mail while reading the news but it only works if
your MAIL environment variable is set. To fix it, simply change the
sprintf()'s in getmailname() and use 'username' instead of the 'p'
pointer (always NULL).


char *
getmailname() {
	static char mailname[32];
	register char *p;

	if( (p = getenv("MAIL")) != NULL)
		return p;
	if (username[0] == '\0' || strlen(username) > 15)
		return NULL;
#ifdef BSD
	sprintf(mailname, "/usr/spool/mail/%s", p);
#else
	sprintf(mailname, "/usr/mail/%s", p);
#endif
	return mailname;
}

>>>>>>>        change to:     <<<<<<<<<

#ifdef BSD
	sprintf(mailname, "/usr/spool/mail/%s", username);
#else
	sprintf(mailname, "/usr/mail/%s", username);
#endif
	return mailname;
}
-- 


 Chris Bertin            :         (617) 657-8720 x2318
 Pixel Computer Inc.     :
 260 Fordham Rd.         :  {allegra|ihnp4|cbosgd|ima|genrad|amd|harvard}\
 Wilmington, Ma 01887    :     !wjh12!pixel!pixutl!chris