Fix -Wunused-but-set-warning with ret

While here, resolve Coverity warnings by demonstrating that vfprintf's
return value is being explicitly ignored.

MFC after:	1 week
Reported by:	gcc 6.3.0
Tested with:	clang, gcc 4.2.1, gcc 6.3.0
Sponsored by:	Dell EMC Isilon
This commit is contained in:
Enji Cooper 2017-03-13 17:15:45 +00:00
parent 6c5b1b394d
commit 513bdaa141
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315200

View File

@ -14,7 +14,7 @@ error(char *fmt, ...)
va_list ap;
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
(void)vfprintf(stderr, fmt, ap);
va_end(ap);
fprintf(stderr, "\n");
@ -24,11 +24,10 @@ error(char *fmt, ...)
int
warning(char *fmt, ...)
{
int ret;
va_list ap;
va_start(ap, fmt);
ret = vfprintf(stderr, fmt, ap);
(void)vfprintf(stderr, fmt, ap);
va_end(ap);
fprintf(stderr, "\n");