From b329cc24102fb46abd0ce05baa0ab7b2a8ca3397 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Mon, 16 Jul 2007 00:09:44 +0000 Subject: [PATCH] Check return code properly in fputs (< 0 is error). --- fips-1.0/hmac/fips_hmactest.c | 2 +- fips-1.0/rsa/fips_rsagtest.c | 4 ++-- fips-1.0/rsa/fips_rsastest.c | 4 ++-- fips-1.0/rsa/fips_rsavtest.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fips-1.0/hmac/fips_hmactest.c b/fips-1.0/hmac/fips_hmactest.c index 6ee4a26b13..59299f4cfa 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 f064162dab..0ae2a29335 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 da78f20671..91047b741b 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 edfa0cfbbf..13dc09a03f 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; } -- 2.25.1