aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libarchive/libarchive/test/test_read_set_format.c
diff options
context:
space:
mode:
authorEnji Cooper <ngie@FreeBSD.org>2016-12-26 06:25:39 +0000
committerEnji Cooper <ngie@FreeBSD.org>2016-12-26 06:25:39 +0000
commit4dd5ec44923f348b4c95beb9752171368ea84a48 (patch)
tree7a14591e18b5b5ba56df5259db2bb766cdc1657c /contrib/libarchive/libarchive/test/test_read_set_format.c
parentb4d1eb23805cc9f39c7506aac30decca09770f90 (diff)
downloadsrc-4dd5ec44923f348b4c95beb9752171368ea84a48.tar.gz
src-4dd5ec44923f348b4c95beb9752171368ea84a48.zip
MFstable/11 r310569:
MFC r309869: Merge changes from vendor to address several Coverity issues with contrib/libarchive's tests Obtained from: libarchive (ebe29c, fd0ea2, f9e3de)
Notes
Notes: svn path=/stable/10/; revision=310570
Diffstat (limited to 'contrib/libarchive/libarchive/test/test_read_set_format.c')
-rw-r--r--contrib/libarchive/libarchive/test/test_read_set_format.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/libarchive/libarchive/test/test_read_set_format.c b/contrib/libarchive/libarchive/test/test_read_set_format.c
index fb5e0047443a..b4f414fa2bb2 100644
--- a/contrib/libarchive/libarchive/test/test_read_set_format.c
+++ b/contrib/libarchive/libarchive/test/test_read_set_format.c
@@ -219,8 +219,8 @@ DEFINE_TEST(test_read_append_filter_wrong_program)
/* bunzip2 will write to stderr, redirect it to a file */
fflush(stderr);
fgetpos(stderr, &pos);
- fd = dup(fileno(stderr));
- fp = freopen("stderr1", "w", stderr);
+ assert((fd = dup(fileno(stderr))) != -1);
+ fp = freopen("stderr1", "w", stderr);
#endif
assert((a = archive_read_new()) != NULL);
@@ -238,10 +238,10 @@ DEFINE_TEST(test_read_append_filter_wrong_program)
if (fp != NULL) {
fflush(stderr);
dup2(fd, fileno(stderr));
- close(fd);
clearerr(stderr);
- fsetpos(stderr, &pos);
+ (void)fsetpos(stderr, &pos);
}
+ close(fd);
assertTextFileContents("bunzip2: (stdin) is not a bzip2 file.\n", "stderr1");
#endif
}