From: Dr. Stephen Henson Date: Mon, 16 Jul 2007 00:09:44 +0000 (+0000) Subject: Check return code properly in fputs (< 0 is error). X-Git-Tag: FIPS_098_TEST_2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b329cc24102fb46abd0ce05baa0ab7b2a8ca3397;p=thirdparty%2Fopenssl.git Check return code properly in fputs (< 0 is error). --- diff --git a/fips-1.0/hmac/fips_hmactest.c b/fips-1.0/hmac/fips_hmactest.c index 6ee4a26b13d..59299f4cfa7 100644 --- a/fips-1.0/hmac/fips_hmactest.c +++ b/fips-1.0/hmac/fips_hmactest.c @@ -176,7 +176,7 @@ int hmac_test(const EVP_MD *md, FILE *out, FILE *in) /* If no = or starts with [ (for [L=20] line) just copy */ if (!p) { - if (!fputs(olinebuf, out)) + if (fputs(olinebuf, out) < 0) goto error; continue; } diff --git a/fips-1.0/rsa/fips_rsagtest.c b/fips-1.0/rsa/fips_rsagtest.c index f064162dab3..0ae2a293352 100644 --- a/fips-1.0/rsa/fips_rsagtest.c +++ b/fips-1.0/rsa/fips_rsagtest.c @@ -120,7 +120,7 @@ int main(int argc, char **argv) if (!rsa_test(out, in)) { - fprintf(stderr, "FATAL RSAVTEST file processing error\n"); + fprintf(stderr, "FATAL RSAGTEST file processing error\n"); goto end; } else @@ -174,7 +174,7 @@ int rsa_test(FILE *out, FILE *in) /* If no = or starts with [ (for [foo = bar] line) just copy */ if (!p || *keyword=='[') { - if (!fputs(olinebuf, out)) + if (fputs(olinebuf, out) < 0) goto error; continue; } diff --git a/fips-1.0/rsa/fips_rsastest.c b/fips-1.0/rsa/fips_rsastest.c index da78f20671e..91047b741b1 100644 --- a/fips-1.0/rsa/fips_rsastest.c +++ b/fips-1.0/rsa/fips_rsastest.c @@ -135,7 +135,7 @@ int main(int argc, char **argv) if (!rsa_stest(out, in, Saltlen)) { - fprintf(stderr, "FATAL RSAVTEST file processing error\n"); + fprintf(stderr, "FATAL RSASTEST file processing error\n"); goto end; } else @@ -190,7 +190,7 @@ int rsa_stest(FILE *out, FILE *in, int Saltlen) /* If no = just copy */ if (!p) { - if (!fputs(olinebuf, out)) + if (fputs(olinebuf, out) < 0) goto error; continue; } diff --git a/fips-1.0/rsa/fips_rsavtest.c b/fips-1.0/rsa/fips_rsavtest.c index edfa0cfbbf4..13dc09a03f6 100644 --- a/fips-1.0/rsa/fips_rsavtest.c +++ b/fips-1.0/rsa/fips_rsavtest.c @@ -193,7 +193,7 @@ int rsa_test(FILE *out, FILE *in, int Saltlen) /* If no = or starts with [ (for [foo = bar] line) just copy */ if (!p || *keyword=='[') { - if (!fputs(olinebuf, out)) + if (fputs(olinebuf, out) < 0) goto error; continue; }