[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: smtpserver talk gibberish on Irises



  Date:	Fri, 11 Sep 1992 12:42:11 -0400
  From:	Guy Middleton <gamiddleton@math.waterloo.edu>
  
  Occasionally, the smtpserver gets into a snit, and type garbage (usually lines
  two characters long) to the SMTP connection.  Has anybody else noticed this
  happening?

The problem seems to be that one really needs to use varargs on Irix.  This patch
fixes the problem:

*** 1.2	1992/09/24 15:30:52
--- smtpserver.c	1992/09/30 22:49:18
***************
*** 1394,1407 ****
  /* VARARGS2 */
  
  void
! type(code, fmt, s1, s2, s3)
  	int code;
! 	char *fmt, *s1, *s2, *s3;
  {
  	char format[BUFSIZ];
  	char *text = NULL;
  	char c;
  
  	if (code < 0) {
  		code = -code;
  		c = '-';
--- 1394,1411 ----
  /* VARARGS2 */
  
  void
! type(code, fmt, va_alist)
  	int code;
! 	char *fmt;
! 	va_dcl
  {
+ 	va_list ap;
  	char format[BUFSIZ];
  	char *text = NULL;
+ 	char *s1, *s2, *s3;
  	char c;
  
+ 	va_start(ap);
  	if (code < 0) {
  		code = -code;
  		c = '-';
***************
*** 1483,1502 ****
--- 1487,1528 ----
  		text = "Transaction failed";
  		break;
  	}
+ #ifndef	USE_VFPRINTF
+ 	s1 = va_arg(ap, char *);
+ 	s2 = va_arg(ap, char *);
+ 	s3 = va_arg(ap, char *);
+ #endif	/* USE_VFPRINTF */
  	if (fmt != NULL)
+ #ifdef	USE_VFPRINTF
+ 		(void) vprintf(fmt, ap);
+ #else	/* USE_VFPRINTF */
  		(void) printf(fmt, s1, s2, s3);
+ #endif	/* USE_VFPRINTF */
  	else
+ #ifdef	USE_VFPRINTF
+ 		(void) vprintf(text, ap);
+ #else	/* USE_VFPRINTF */
  		(void) printf(text, s1, s2, s3);
+ #endif	/* USE_VFPRINTF */
  	(void) printf("\r\n");
  	(void) fflush(stdout);
  	if (logfp != NULL) {
  		if (fmt != NULL)
+ #ifdef	USE_VFPRINTF
+ 			(void) vfprintf(logfp, fmt, ap);
+ #else	/* USE_VFPRINTF */
  			(void) fprintf(logfp, fmt, s1, s2, s3);
+ #endif	/* USE_VFPRINTF */
  		else
+ #ifdef	USE_VFPRINTF
+ 			(void) vfprintf(logfp, text, ap);
+ #else	/* USE_VFPRINTF */
  			(void) fprintf(logfp, text, s1, s2, s3);
+ #endif	/* USE_VFPRINTF */
  		(void) fprintf(logfp, "\n");
  		(void) fflush(logfp);
  	}
+ 	va_end(ap);
  }
  
  /* Implement SMTP DATA filter */