bin/79232: WARNS6 clean libexec/comsat

Stefan Farfeleder stefanf at FreeBSD.org
Sat Mar 26 00:30:06 PST 2005


The following reply was made to PR bin/79232; it has been noted by GNATS.

From: Stefan Farfeleder <stefanf at FreeBSD.org>
To: bug-followup at FreeBSD.org
Cc:  
Subject: bin/79232: WARNS6 clean libexec/comsat
Date: Sat, 26 Mar 2005 09:23:05 +0100

 > -	sprintf(buf, "%s/%.*s", _PATH_MAILDIR, (int)sizeof(utmp[0].ut_name),
 > -	    name);
 > +	sprintf(buf, "%s/%.*s", _PATH_MAILDIR, sizeof(utmp[0].ut_name), name);
 >  	if (*file != '/') {
 >  		sprintf(buf2, "%s/%.*s", _PATH_MAILDIR,
 > -		    (int)sizeof(utmp[0].ut_name), file);
 > +		      sizeof(utmp[0].ut_name), file);
 
 
 > -	(void)snprintf(tty, sizeof(tty), "%s%.*s",
 > -	    _PATH_DEV, (int)sizeof(utp->ut_line), utp->ut_line);
 > +	snprintf(tty, sizeof(tty), "%s%.*s",
 > +	      _PATH_DEV, sizeof(utp->ut_line), utp->ut_line);
 
 
 > -		(void)fprintf(tp, 
 > +		fprintf(tp, 
 >  		    "%s\007New mail for %s@%.*s\007 has arrived%s%s%s:%s----%s",
 > -		    cr, name, (int)sizeof(hostname), hostname,
 > +		    cr, utp->ut_name, sizeof(hostname), hostname,
 >  		    folder ? cr : "", folder ? "to " : "", folder ? file : "",
 >  		    cr, cr);
 
 Those (int) casts are needed, removing them is an error.
 
 Stefan


More information about the freebsd-bugs mailing list