From a1e6ba6477b4a78182598c2e9a2ad604e46f52a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 10 Aug 2015 17:15:43 +0200 Subject: [PATCH] Fix compiler warning in test --- tests/suites/test_suite_x509write.function | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/suites/test_suite_x509write.function b/tests/suites/test_suite_x509write.function index 3d09d8597..8155b5a8c 100644 --- a/tests/suites/test_suite_x509write.function +++ b/tests/suites/test_suite_x509write.function @@ -18,7 +18,7 @@ x509_cert_req_check:key_file:md_type:cert_req_check_file unsigned char buf[4000]; unsigned char check_buf[4000]; int ret; - size_t olen = 2000; + size_t olen = 2000, r; FILE *f; cur = &req_name; @@ -52,8 +52,9 @@ x509_cert_req_check:key_file:md_type:cert_req_check_file f = fopen( {cert_req_check_file}, "r" ); TEST_ASSERT( f != NULL ); - (void) fread( check_buf, 1, 4000, f ); + r = fread( check_buf, 1, 4000, f ); fclose( f ); + TEST_ASSERT( r != 0 ); pem_init( &pem ); pem_read_buffer( &pem, (char *) "-----BEGIN CERTIFICATE REQUEST-----", (char *) "-----END CERTIFICATE REQUEST-----", check_buf, NULL, 0, &olen );